commit | 7301979b23406220510dd2c7934a21b41b647119 | [log] [tgz] |
---|---|---|
author | Yurii Karabas <1998uriyyo@gmail.com> | Wed Nov 25 12:43:18 2020 +0200 |
committer | GitHub <noreply@github.com> | Wed Nov 25 19:43:18 2020 +0900 |
tree | 296b337317ac71d34001c17f4b4b7bea918cbf6f | |
parent | 85c84920f511d0d73a133336daeaf715a022cd64 [diff] |
bpo-42202: Store func annotations as a tuple (GH-23316) Reduce memory footprint and improve performance of loading modules having many func annotations. >>> sys.getsizeof({"a":"int","b":"int","return":"int"}) 232 >>> sys.getsizeof(("a","int","b","int","return","int")) 88 The tuple is converted into dict on the fly when `func.__annotations__` is accessed first. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>