mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-44654: Refactor and clean up the union type implementation (GH-27196)
This commit is contained in:
parent
f88e138a1a
commit
0fd27375ca
9 changed files with 88 additions and 125 deletions
|
@ -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__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue