instance.attribute lookup

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Oct 5 19:00:30 EDT 2012


On Fri, 05 Oct 2012 10:39:53 -0700, Ethan Furman wrote:

> There is a StackOverflow question [1] that points to this on-line book
> [2] which has a five-step sequence for looking up attributes:
> 
>  > When retrieving an attribute from an object (print
>  > objectname.attrname) Python follows these steps:
>  >
>  > 1. If attrname is a special (i.e. Python-provided) attribute for
>  > objectname, return it.
[...]
> I'm thinking step 1 is flat-out wrong and doesn't exist.  Does anybody
> know otherwise?

I'm thinking I don't even understand what step 1 means.

What's a Python-provided attribute, and how is it different from other 
attributes?



-- 
Steven



More information about the Python-list mailing list