diff options
| author | Yurii Karabas <1998uriyyo@gmail.com> | 2020-11-19 18:17:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-19 08:17:38 -0800 |
| commit | 1b54077ff6f5c1379e097e9f8e8648da9826d6ec (patch) | |
| tree | c8de68da519cd471ef2ea002b8a1f51fa97a8203 /Lib/typing.py | |
| parent | b437aa83f9374b86b7756705e8dc83b72a99e037 (diff) | |
| download | cpython-git-1b54077ff6f5c1379e097e9f8e8648da9826d6ec.tar.gz | |
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Fix hash implementation of `typing.Literal`.
Update docs regarding `typing.Litaral` caching.
Base implementation was done in PR #23294.
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 d310b3dd58..46c54c4069 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -981,7 +981,7 @@ class _LiteralGenericAlias(_GenericAlias, _root=True): return set(_value_and_type_iter(self.__args__)) == set(_value_and_type_iter(other.__args__)) def __hash__(self): - return hash(tuple(_value_and_type_iter(self.__args__))) + return hash(frozenset(_value_and_type_iter(self.__args__))) class Generic: |
