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 serhiy.storchaka
Recipients methane, serhiy.storchaka
Date 2020-10-30.07:39:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604043564.59.0.662897993877.issue42202@roundup.psfhosted.org>
In-reply-to
Content
Are annotations now always known at compile time?

As for representation, it can also be a sequence of pairs (('x', 'int'), ('z', 'float'), ('return', 'Hoge')) or a pair of sequences (('x', 'z', 'return'), ('int', 'float', 'Hoge')). It would be better to save a dict directly in pyc files, but it needs changing the marshal protocol.

Also, it makes sense to make annotations attribute of the code object, so avoid the overhead at function creation time.

I have a dream to split the pyc file into several files or sections and save docstrings and annotations (and maybe line numbers) separately from the main code. They should be loaded by demand, when you read __doc__ or __annotation__. Most code does not use them at run time, so we can save memory and loading time. It can also help with internationalization.
History
Date User Action Args
2020-10-30 07:39:24serhiy.storchakasetrecipients: + serhiy.storchaka, methane
2020-10-30 07:39:24serhiy.storchakasetmessageid: <1604043564.59.0.662897993877.issue42202@roundup.psfhosted.org>
2020-10-30 07:39:24serhiy.storchakalinkissue42202 messages
2020-10-30 07:39:24serhiy.storchakacreate