4 Dec
2019
4 Dec
'19
4:59 p.m.
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