-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as duplicate of#107271
Closed as duplicate of#107271
Copy link
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
python 3.13
# Add a code block here, if required
>>> from types import NoneType
>>> None | int
None | int
>>> int | None
int | None
>>> None | int == int | None
True
>>> NoneType | int == None | int
True
>>> NoneType | NoneType
<class 'NoneType'>
>>> NoneType | NoneType == NoneType
True
>>> from typing import Union
>>> Union[None, None]
<class 'NoneType'>
>>> NoneType | None
<class 'NoneType'>
>>> None | NoneType
<class 'NoneType'>
>>> Union[None, NoneType]
<class 'NoneType'>
>>> None | None
Traceback (most recent call last):
File "<python-input-50>", line 1, in <module>
None | None
~~~~~^~~~~~
TypeError: unsupported operand type(s) for |: 'NoneType' and 'NoneType'
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error