Jeremy Hylton wrote at 2003-11-24 14:06 -0500:
 > ...
 > One of the key properties of C3 is local order is honored.  If
 > a class A has two base classes B and C, then a method defined in B and C
 > (perhaps via their base classes) will be found in B first.  
 > 
 > This matches the way I think about inheritance, but not the way the old
 > algorithm works.

Are you sure?

  The old algorithm is described in the Python Language Reference:

    Class attribute references are translated to lookups in this
    dictionary, e.g., "C.x" is translated to "C.__dict__["x"]". When
    the attribute name is not found there, the attribute search
    continues in the base classes. The search is depth-first,
    left-to-right in the order of occurrence in the base class list.

  Thus, if class "B" comes before class "C" in the list of
  base classes, "B"s attributes are found in preference of "A"s attributes.

-- 
Dieter

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to