Hello,

Why is this?

>>> class MyTuple(tuple):
... def __getitem__(self, name):
... return tuple.__getitem__(self, name)
...
>>> data = (1,2,3,4,5)
>>> t = MyTuple(data)
>>> t[0]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in __getitem__
TypeError: descriptor '__getitem__' requires a 'tuple' object but received a 'int'


Thanks,

VL

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

Reply via email to