This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients Mark.Shannon, corona10, jstasiak, methane, serhiy.storchaka, uriyyo
Date 2020-11-18.00:50:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605660623.9.0.401771186586.issue42202@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-11-18 00:50:23methanesetrecipients: + methane, Mark.Shannon, serhiy.storchaka, jstasiak, corona10, uriyyo
2020-11-18 00:50:23methanesetmessageid: <1605660623.9.0.401771186586.issue42202@roundup.psfhosted.org>
2020-11-18 00:50:23methanelinkissue42202 messages
2020-11-18 00:50:23methanecreate