This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bobbeyreese
Recipients bobbeyreese
Date 2021-10-15.16:37:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634315851.69.0.0714715298786.issue45489@roundup.psfhosted.org>
In-reply-to
Content
Not positive this is a bug, but it seems like ForwardRef should support the pipe (|) operator for indicating Unions in Python 3.10:

Python 3.10.0 (default, Oct  4 2021, 22:09:55) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import ForwardRef
>>> ForwardRef('asdf') | ForwardRef('fdsa')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'ForwardRef' and 'ForwardRef'
>>> int | str
int | str
>>>
History
Date User Action Args
2021-10-15 16:37:31bobbeyreesesetrecipients: + bobbeyreese
2021-10-15 16:37:31bobbeyreesesetmessageid: <1634315851.69.0.0714715298786.issue45489@roundup.psfhosted.org>
2021-10-15 16:37:31bobbeyreeselinkissue45489 messages
2021-10-15 16:37:31bobbeyreesecreate