[New-bugs-announce] [issue44353] PEP 604 NewType

Joseph Perez report at bugs.python.org
Tue Jun 8 16:21:48 EDT 2021


New submission from Joseph Perez <joperez at hotmail.fr>:

`typing.NewType` doesn't support PEP 604.

```
>>> import typing
>>> A = typing.NewType("A", int)
>>> B = typing.NewType("B", str)
>>> A | B
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'function' and 'function'
```

----------
messages: 395359
nosy: joperez
priority: normal
severity: normal
status: open
title: PEP 604 NewType
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44353>
_______________________________________


More information about the New-bugs-announce mailing list