Re: Subclassing list and splicing

2009-09-04 Thread Nobody
On Thu, 03 Sep 2009 17:10:12 +, Kreso wrote: > I would prefer that resulting object m belonged to myclist class. > How to obtain such behaviour? Must I somehow implement __getslice__ > method myself? Yes; you should also implement __getitem__(), as this is used for extended slices. -- http:

Re: Subclassing list and splicing

2009-09-03 Thread Kreso
Kreso wrote: [...] > I would prefer that resulting object m belonged to myclist class. I forgot to add that mylist instances in my case have some attributes (that's why I need special container class in the first place) which should be preserved after splicing. In my simple understaning of pyth

Re: Subclassing list and splicing

2009-09-03 Thread Emile van Sebille
On 9/3/2009 10:10 AM Kreso said... I am subclassing list class and it basically works, but I don't understand why after splicing these mylist objects I don't get returned mylist objects. What I get are list objects: I would prefer that resulting object m belonged to myclist class. How to obtai