This is one of the exception cases in my proposal, variables used inside their own methods don't have __getself__ called when they are loaded.

The proposal basically reads:
class instances that are looked up with a named variable will have __getself__ invoked when the interpreter loads them, except when they are used within their own methods, or when used as an argument to/from a function.

That second part about functions was not part of the original proposal, but is something I am currently exploring to address some questions others have raised. I have not fully thought about what the consequences would be, and it may or may not stick around in the long term. I feel quite strongly about the first exception however, as it makes writing a class body manageable, without over burdening the author to put special escape functions all over the place.

On Thu, Jun 27, 2019 at 7:42 PM Greg Ewing <> wrote:
Sorry if this has already been answered, but if it has I missed it.

 From your demo:

class HistoricVar:

     def __getself__(self):
         return self.var

What stops the reference to 'self' here from invoking __getself__ again?

Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct:

Nate Lust, PhD.
Astrophysics Dept.
Princeton University