durusmail: durus-users: Subclassing PersistentList
Subclassing PersistentList
2009-10-13
2009-10-15
2009-10-15
Subclassing PersistentList
Patrick Dobbs
2009-10-15
Thanks for that.

I figured out that subclassing the container methods is problematic
since they override the comparison methods (e.g. __eq__) to delegate
calls to the wrapped List property (data). Given that I agree that
there's no benefit in adding super() calls.

Regards

Patrick



Binger David wrote:
> Hi Patrick,
>
> These container classes are not intended to be subclassed at all,
> and we never do that in our own applications.
>
> If we added the super() calls, we might possibly break other people's
> subclasses that depend (unfortunately) on not calling the next
> __init__() in the inheritance tree. Is it worth this risk?
>
> When we use Mixins in other contexts, we just call the
> parent __init__() methods explicitly so that the behavior is
> easier to understand. Would that work as well for you?
>
> And I'm glad you like Durus! We like it too.
>
> - David
>

reply