]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43901: Lazy-create an empty annotations dict in all unannotated user classes...
authorlarryhastings <larry@hastings.org>
Fri, 30 Apr 2021 03:09:08 +0000 (20:09 -0700)
committerGitHub <noreply@github.com>
Fri, 30 Apr 2021 03:09:08 +0000 (20:09 -0700)
commit2f2b69855d6524e15d12c15ddc0adce629e7de84
treeaac6542c35708f45670fc5ae027a9fc1802e8498
parentdbe60ee09dc5a624cfb78dff61ecf050a5b3f105
bpo-43901: Lazy-create an empty annotations dict in all unannotated user classes and modules (#25623)

Change class and module objects to lazy-create empty annotations dicts on demand.  The annotations dicts are stored in the object's `__dict__` for backwards compatibility.
Lib/test/ann_module4.py [new file with mode: 0644]
Lib/test/test_grammar.py
Lib/test/test_module.py
Lib/test/test_opcodes.py
Lib/test/test_type_annotations.py [new file with mode: 0644]
Lib/typing.py
Misc/NEWS.d/next/Core and Builtins/2021-04-25-22-50-47.bpo-43901.oKjG5E.rst [new file with mode: 0644]
Objects/moduleobject.c
Objects/typeobject.c