Ken Jin <kenjin4...@gmail.com> added the comment:
Nosied over people from issue44490. This issue addresses msg396895: Thanks to Ruben for the catch. (message copied over): ``` It also lacks the __module__ attribute, causing it to be unusable in PEP 593 typing.Annotated types: from typing import Annotated x: Annotated[int | str, 'test'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 298, in inner return cached(*args, **kwds) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1594, in __class_getitem__ return _AnnotatedAlias(origin, metadata) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1520, in __init__ super().__init__(origin, origin) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 976, in __init__ self.__module__ = origin.__module__ AttributeError: 'types.Union' object has no attribute '__module__'. Did you mean: '__reduce__'? ``` ---------- nosy: +ROpdebee, gvanrossum, kj, serhiy.storchaka versions: +Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44662> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com