[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-19 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 955d3faf727a by Guido van Rossum in branch '3.5': Issue #25390: typing: Don't crash on Union[str, Pattern]. https://hg.python.org/cpython/rev/955d3faf727a New changeset 04314479af0b by Guido van Rossum in branch 'default': Issue #25390: typing:

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Martí Congost Tapias
New submission from Martí Congost Tapias: Defining a union of typing.re.Pattern and anything that isn't AnyStr raises a TypeError exception. Example: from typing import Union, re def foo(pattern: Union[str, re.Pattern]) -> None: pass Exception traceback: Traceback (most recent call

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker ___ ___

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Martí Congost Tapias
Changes by Martí Congost Tapias : -- components: +Library (Lib) -Interpreter Core ___ Python tracker ___

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Guido van Rossum
Guido van Rossum added the comment: 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?) -- nosy: +gvanrossum ___ Python tracker

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Guido van Rossum
Changes by Guido van Rossum : -- assignee: -> gvanrossum ___ Python tracker ___ ___