mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
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.
This commit is contained in:
parent
dbe60ee09d
commit
2f2b69855d
9 changed files with 308 additions and 8 deletions
5
Lib/test/ann_module4.py
Normal file
5
Lib/test/ann_module4.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
# This ann_module isn't for test_typing,
|
||||
# it's for test_module
|
||||
|
||||
a:int=3
|
||||
b:str=4
|
Loading…
Add table
Add a link
Reference in a new issue