On Tue, 30 Aug 2005 08:53:27 GMT, Bryan Olson <[EMAIL PROTECTED]> wrote:
>     Specifically, to support new-style slicing, a class that
>     accepts index or slice arguments to any of:
>
>         __getitem__
>         __setitem__
>         __delitem__
>         __getslice__
>         __setslice__
>         __delslice__
>
>     must also consistently implement:
>
>         __len__
>
>     Sane programmers already follow this rule.


Wouldn't it be more sensible to have an abstract IndexedCollection 
superclass, which imlements all the slicing stuff, then when someone 
writes their own collection class they just have to implement 
__len__ and __getitem__ and slicing works automatically?


-- 
Email: zen19725 at zen dot co dot uk


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to