Multiple inheritance, super() and changing signature

Michael Selik michael.selik at gmail.com
Fri Jun 3 12:28:20 EDT 2016


On Fri, Jun 3, 2016 at 12:01 PM Nagy László Zsolt <gandalf at shopzeus.com>
wrote:

> > Is the problem that the attribute or parameter has the same name in
> both base classes, but has different meanings in each?
> If they had different meanings, a simple rename would solve the problem.
>

Sometimes finding a good name ain't so simple.

> If you can't change the base classes, I've got some other solutions, but
> > they're more involved, so I'll wait to hear back.
> One possible solution being encapsulating an object instead of
> inheriting from it?
>

That's one option, creating a wrapper class that dispatches almost
everything to the contained class, except with one renamed attribute/method.



More information about the Python-list mailing list