New submission from Bobbey Reese <bobbeyre...@gmail.com>:

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
>>>

----------
messages: 404037
nosy: bobbeyreese
priority: normal
severity: normal
status: open
title: ForwardRef does not support | operator
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45489>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to