[issue29262] Provide a way to check for *real* typing.Union instances

Ivan Levkivskyi report at bugs.python.org
Sun Jan 15 17:07:26 EST 2017


Ivan Levkivskyi added the comment:

In principle, such a function could be added if it is not called ``isinstance``. For example, we could add a helper ``is_union(tp)`` (or maybe also ``is_generic(tp)`` etc). Such function(s) will be simple one-liners wrapping private API in a right way (e.g. using _gorg instead of __origin__ where needed etc).

Guido, what do you think?

----------
nosy: +gvanrossum, levkivskyi
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29262>
_______________________________________


More information about the Python-bugs-list mailing list