On Fri, 16 Apr 2021, 3:14 pm Larry Hastings, <email@example.com> wrote:
Anyway I assume it wasn't "fixable". The compiler would presumably already prefer to generate LOAD_GLOBAL vs LOAD_NAME, because LOAD_GLOBAL would be cheaper every time for a global or builtin. The fact that it already doesn't do so implies that it can't.Metaclass __prepare__ methods can inject names into the class namespace that the compiler doesn't know about, so yeah, it unfortunately has to be conservative and use LOAD_NAME in class level code.
Python-Dev mailing list -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com
Message archived at https://firstname.lastname@example.org/message/IZJYDHWJNMMMICUE32M3O7DGMSMVIOQ3/
Code of Conduct: http://python.org/psf/codeofconduct/