[Tutor] class overriding question

Brian van den Broek bvande at po-box.mcgill.ca
Sat Dec 18 20:24:24 CET 2004


Kent Johnson said unto the world upon 2004-12-18 08:53:
> Yup, that's right!
> 
> Attribute access (the dot operator '.') is an operation that happens at 
> runtime, and each attribute access stands alone. Every attribute access 
> goes through the same search path, starting with self, then the class 
> (type) of self, finally the base classes. So, in your example, self.foo 
> is found in the class of bar, while self.ham is found in the base class 
> of the class of bar.
> 
> Kent
> 
> Brian van den Broek wrote:

<SNIP a quotation from Pilgrim's Dive Into Python itself quoting Guido 
on a point about how method inheritance works and 3 related ways I
reconstructed it to make sure I had the intent of Guido's point>

Thanks Kent! I appreciate the external check. (The way Guido made the 
point was a bit gnostic, but not perhaps so much as Pilgrim's comment 
made it out.)

Best to all,

Brian vdB




More information about the Tutor mailing list