[Tutor] custom container subclassing list-- slices are lists!?
magoldfish at gmail.com
Mon Aug 21 22:50:37 CEST 2006
I'd like to sublcass the built-in list type to create my own container. How
can I make slices of the list be of type myclass-- currently they are
>>> class MyFoo(list):
def __init__(self, inlist):
self = inlist[:]
>>> me = MyFoo(range(10))
All help appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor