Re: instance.attribute lookup

2012-10-05 Thread Mark Lawrence
On 06/10/2012 00:12, Ethan Furman wrote: Steven D'Aprano wrote: 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

Re: instance.attribute lookup

2012-10-05 Thread Ian Kelly
On Fri, Oct 5, 2012 at 11:39 AM, 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:

Re: instance.attribute lookup

2012-10-05 Thread Christian Heimes
Am 05.10.2012 19:39, schrieb Ethan Furman: > I'm thinking step 1 is flat-out wrong and doesn't exist. Does anybody > know otherwise? The answer is confusing and also wrong. For instance it ignores the existence of __slots__, metaclasses and the different lookup strategy of __special__ methods in

Re: instance.attribute lookup

2012-10-05 Thread Ethan Furman
Steven D'Aprano wrote: 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) Pyth

Re: instance.attribute lookup

2012-10-05 Thread Steven D'Aprano
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

instance.attribute lookup

2012-10-05 Thread Ethan Furman
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) attr