diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-07-17 19:44:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 19:44:10 (GMT) |
commit | 0fd27375cabd12e68a2f12cfeca11a2d5043429e (patch) | |
tree | acb748d0bc66167f6f0d6d30123a205fc5af3e9b /Lib/typing.py | |
parent | f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c (diff) | |
download | cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.zip cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.tar.gz cpython-0fd27375cabd12e68a2f12cfeca11a2d5043429e.tar.bz2 |
bpo-44654: Refactor and clean up the union type implementation (GH-27196)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index cc7f41d..59f3ca3 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1184,7 +1184,7 @@ class _UnionGenericAlias(_GenericAlias, _root=True): return Union[params] def __eq__(self, other): - if not isinstance(other, _UnionGenericAlias): + if not isinstance(other, (_UnionGenericAlias, types.Union)): return NotImplemented return set(self.__args__) == set(other.__args__) |