Subclassing list and splicing
Emile van Sebille
emile at fenx.com
Thu Sep 3 19:37:39 CEST 2009
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 obtain such behaviour? Must I somehow implement __getslice__
> method myself?
Yep -- something like:
if val is None:
More information about the Python-list