gh-109653: typing.py: improve import time by creating soft-deprecated members on demand (#109651)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
Alex Waygood 2023-09-23 08:46:35 +01:00 committed by GitHub
parent 62c7015e89
commit e8be0c9c5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 8 deletions

View file

@ -9373,6 +9373,10 @@ class AllTests(BaseTestCase):
self.assertIn('SupportsComplex', a)
def test_all_exported_names(self):
# ensure all dynamically created objects are actualised
for name in typing.__all__:
getattr(typing, name)
actual_all = set(typing.__all__)
computed_all = {
k for k, v in vars(typing).items()