We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Sentinel
1 parent 44de568 commit c9fba13Copy full SHA for c9fba13
1 file changed
src/typing_extensions.py
@@ -4244,11 +4244,12 @@ def __repr__(self):
4244
def __call__(self, *args, **kwargs):
4245
raise TypeError(f"{type(self).__name__!r} object is not callable")
4246
4247
- def __or__(self, other):
4248
- return typing.Union[self, other]
4249
-
4250
- def __ror__(self, other):
4251
- return typing.Union[other, self]
+ if sys.version_info >= (3, 10):
+ def __or__(self, other):
+ return typing.Union[self, other]
+
+ def __ror__(self, other):
4252
+ return typing.Union[other, self]
4253
4254
def __getstate__(self):
4255
raise TypeError(f"Cannot pickle {type(self).__name__!r} object")
0 commit comments