[3.14] gh-133925: Make typing._UnionGenericAlias hashable (GH-133929) (#133936)

gh-133925: Make typing._UnionGenericAlias hashable (GH-133929)
(cherry picked from commit 8d478c7953)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-05-12 17:50:10 +02:00 committed by GitHub
parent ecc12bff24
commit 89c801b84e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -10731,6 +10731,9 @@ class UnionGenericAliasTests(BaseTestCase):
with self.assertWarns(DeprecationWarning):
self.assertNotEqual(int, typing._UnionGenericAlias)
def test_hashable(self):
self.assertEqual(hash(typing._UnionGenericAlias), hash(Union))
def load_tests(loader, tests, pattern):
import doctest