On Wed, Jul 28, 2021 at 3:56 PM Yua <[email protected]> wrote: > > Thank you for bringing that to my attention! > > I think maybe can the interpreter decide whether __class__ etc. should be > added to the environment with regard to how the function is called? > > The interpreter does not provide __class__ etc. for plain placement() calls, > but provide them at calls like child().foo() - when the callee function is > named as a class method. Dynamically. >
No, because it can't know WHICH class it should be referencing. The entire point of the name __class__ is that it refers to the class being defined, so it has to be added at compilation time. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/VOCITPCY3C6OIVGJWBEZ4UVV5SAQ4F3O/ Code of Conduct: http://python.org/psf/codeofconduct/
