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"
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__
):… otherwise the message will always be
"type: cannot construct instance of union"