What is "self"?

M

Michael Spencer

Ron said:
What I've noticed is you can block the visibility of a class attribute,
which include methods, by inserting an object in the instance with the
same name.
[snip example of this behavior]

Yes, that's true for "non-data descriptors" (see last two bullets below)

Raymond Hettinger [http://users.rcn.com/python/download/Descriptor.htm]
>
> The important points to remember are:
>
> * descriptors are invoked by the __getattribute__ method
> * overriding __getattribute__ prevents automatic descriptor calls
> * __getattribute__ is only available with new style classes and objects
> * object.__getattribute__ and type.__getattribute__ make different calls to __get__.
> * data descriptors always override instance dictionaries.
> * non-data descriptors may be overridden by instance dictionaries.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,323
Members
48,006
Latest member
TerranceCo

Latest Threads

Top