Author ROpdebee
Recipients Jelle Zijlstra, ROpdebee, brandtbucher, gvanrossum, jack__d, kj, levkivskyi, uriyyo
Date 2021-07-03.11:13:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625310797.28.0.0735529552164.issue44490@roundup.psfhosted.org>
In-reply-to
Content
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__'?
History
Date User Action Args
2021-07-03 11:13:17ROpdebeesetrecipients: + ROpdebee, gvanrossum, levkivskyi, Jelle Zijlstra, brandtbucher, uriyyo, kj, jack__d
2021-07-03 11:13:17ROpdebeesetmessageid: <1625310797.28.0.0735529552164.issue44490@roundup.psfhosted.org>
2021-07-03 11:13:17ROpdebeelinkissue44490 messages
2021-07-03 11:13:16ROpdebeecreate