inheritedAttribute search order
Ooh, ooh, I know the answer to this one!!! Per the Python 2.3.2 documentation, Section 9.5.1, it's a depth-first, left to right resolution. In this case, it's Base1 -> Base2 -> Base3 If Base1 is a subclass of Base0, then it's Base1 -> Base0 -> Base2 -> Base3 Ken
Date: Mon, 27 Oct 2003 17:19:01 +0100 From: "Gilles Lenfant" <gilles@pilotsystems.net> Subject: [Zope] inheritedAttribute search order To: <zope@zope.org> Message-ID: <052d01c39ca6$085ea370$0301a8c0@provence> Content-Type: text/plain; charset="iso-8859-1"
Hi,
Given such a situation...
class MyClass(Base1, Base2, Base3): ... def foo(self, arg1, arg2): """ """ x = ... y = ... ... z = MyClass.inheritedAttribute('foo')(self, x, y) ...
In the case where more than one base class has a "foo" method/attribute, in what order does inheritedAttribute() search that "foo" attribute ?
Base1 -> Base2 -> Base3 ? Base3 -> Base2 -> Base1 ? Other ?
Many thanks in advance.
--
participants (1)
-
Ken Whitesell