Class variable inheritance

Mark Hammond skippy.hammond at gmail.com
Wed Sep 9 00:00:08 EDT 2009


On 9/09/2009 1:51 PM, HPJ wrote:
>> Conceptually, Python checks for the presence of B.foo, and if it's
>> not there it checks for foo's presence in the base classes.
>
> Yes, I have no problem believing you guys that this is what Python
> does. Still, my question remains about where in the Language Reference
> this is specified. And if the answer is nowhere, than the LR needs to
> be amended, for obviously the way inheritance is done is no small
> matter and its understanding should not be left to the user's own
> intuition.

http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes 
- search for 'method resolution order' for other hits in that document.

HTH,

Mark



More information about the Python-list mailing list