__setitem__ without position

Kevin Anthony kevin.s.anthony at gmail.com
Thu Oct 11 16:48:17 EDT 2012


I have a class that contains a list of items
I can set items using __setitem__ but if i want to set the while list, i
changes the variable from a myclass to a list.  How can i accomblish this
Example
>>>C = myclass()
>>>C[0] = 57
>>>type(C)
myclass
>>> C = [57,58,59,60]
>>>type(C)
list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121011/f8d7ed1d/attachment.html>


More information about the Python-list mailing list