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

flying sheep report at bugs.python.org
Mon Jan 16 05:03:57 EST 2017


flying sheep added the comment:

Cool! This set of basic initial check will consist of all the is_* functions that were mentioned right?

FWIW I also think that this is the way to go, as it’s not obvious if the semantics should be “conforms to this type annotation” or “is a type annotation of that kind” or other variants.

In case this isn’t already too much future think: What should be the way forward from there? E.g. when working with Union[A, B], you will probably want to get “(A, B)”.

So will that mean more introspection functions (like union_types(Union[str,int]),
or public APIs for typings (e.g. a_union.__iter__() or a_union.types)?

----------

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


More information about the Python-bugs-list mailing list