[issue32550] STORE_ANNOTATION bytecode is unnecessary and can be removed.

Serhiy Storchaka report at bugs.python.org
Sat Jan 20 02:49:50 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

> This PR moves the constant for the name from `co_names` to `co_consts`. There is no duplication.

But if there is an initializer, the name is left in `co_names` too.

I don't think this (as well as possible performance difference) is important. My only concerns are about subtle behavior differences.

For example, is the name always interned (even if long or non-ASCII)? Does any code depend on interning keys in __annotations__? (There is a code that depends on interning keys in type.__dict__).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32550>
_______________________________________


More information about the Python-bugs-list mailing list