Serhiy Storchaka <[email protected]> added the comment:
It cannot use LOAD_GLOBAL because the name can be not global. For example:
def f(self): ...
f = property(f)
It cannot use STORE_FAST and LOAD_FAST because they work with specific
representation of locals as array, but in a class body it can be arbitrary
mapping (returned by __prepare__()).
Also, executing bytecode takes only minor part of the class creation time, so
optimization of LOAD_NAME and STORE_NAME is preliminary.
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42185>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com