On Wed, Dec 4, 2019, at 11:51, Chris Angelico wrote:
> Which of these are you expecting to be detected, and thus cause the
> change in bytecode?

More or less the same sort of operations where the use of the name super is 
detected within methods and causes the enclosing class to have a __class__ cell.

> __operatorhook_or__ = lambda obj1, obj2: ...
yes

> def init():
>     global __operatorhook_or__
>     def __operatorhook_or__(obj1, obj2): ...
> init()
yes

> globals()["__operatorhook_or__"] = lambda obj1, obj2: ...
no

> exec("def __operatorhook_or__(obj1, obj2): ...")
no

> from othermodule import __operatorhook_or__
yes

> from othermodule import *
no
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BKISATWOR5T3ZJQTAD6STAA5E4ZPJKGK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to