Message381309
I don't like co_annotations.
* It changes PyCode_NewXXX() API.
* Many functions don't have annotations. Adding annotation to code object makes code object fatter even if the function doesn't have annotation.
* Code object is immutable & hashable. Adding annotation to code object makes == and hash() complex.
* We may introduce lazy loading for docstring and annotation in the future.
func.__annotations__ = ('x', 'int', 'z', 'float', 'return', 'Hoge') is much better because:
* Zero overhead for functions without any annotations.
* After annotation dict is created, the tuple can be released. |
|
Date |
User |
Action |
Args |
2020-11-18 00:50:23 | methane | set | recipients:
+ methane, Mark.Shannon, serhiy.storchaka, jstasiak, corona10, uriyyo |
2020-11-18 00:50:23 | methane | set | messageid: <1605660623.9.0.401771186586.issue42202@roundup.psfhosted.org> |
2020-11-18 00:50:23 | methane | link | issue42202 messages |
2020-11-18 00:50:23 | methane | create | |
|