overriding base class

Michele Simionato michele.simionato at gmail.com
Sat Jun 30 08:45:37 CEST 2007


On Jun 30, 5:23 am, Carl Banks <pavlovevide... at gmail.com> wrote:

> Now that I've suggested that, I highly recommend you be sure you're
> very acquainted with new-style objects and method resolution order
> before attempting this.  You need extra care when using MI, even
> though this use of it is rather tame.
>
> Cark Banks

I would say that the burden on the writer of the hierarchy is not that
much.
The real burder is on the *reader* of the code, which can get easily
confused from where methods are coming. This is way I usually do not
recommend MI: because of the reading and maintenance effort (see for
instance the nightmarish situation in Zope 2). To the OP I would
suggest to
consider containment instead, to consider using proxy objects,
__getattr__ and
other similiar tricks that usually do the job.

    Michele Simionato




More information about the Python-list mailing list