pyxb
pyxb copied to clipboard
creating an instance of a union does not name the actual type in the resulting exception
https://github.com/pabigot/pyxb/blob/14737c23a125fd12c954823ad64fc4497816fae3/pyxb/binding/basis.py#L1295-L1296
Because in __new__ the first argument is actually the class (of which an instance is to be constructed), so if we actually want this message to be helpful, it should probably look like this (i.e.: without the .__class__):
raise pyxb.LogicError('%s: cannot construct instances of union' % (self.__name__,))
… otherwise the message will always be "type: cannot construct instance of union"