You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/gvanrossum'closed_at=<Date2015-10-19.21:57:04.177>created_at=<Date2015-10-13.09:27:47.517>labels= ['type-bug', 'library']
title="Can't define a typing.Union containing a typing.re.Pattern"updated_at=<Date2015-10-19.21:57:04.176>user='https://bugs.python.org/MartCongostTapias'
Traceback (most recent call last):
File "/tmp/testtyping.py", line 7, in <module>deffoo(pattern: Union[str, re.Pattern]) -> None:
File "/usr/local/lib/python3.5/typing.py", line 534, in __getitem__dict(self.__dict__), parameters, _root=True)
File "/usr/local/lib/python3.5/typing.py", line 491, in __new__for t2 in all_params - {t1} ifnotisinstance(t2, TypeVar)):
File "/usr/local/lib/python3.5/typing.py", line 491, in <genexpr>for t2 in all_params - {t1} ifnotisinstance(t2, TypeVar)):
TypeError: issubclass() arg 1 must be a class
Confirmed. The failure is because Pattern is _TypeAlias, which is not a type. But it should be allowed. I'll think of something. (Does mypy accept this?)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: