On 5/23/06, Andrew Dalke <dalke@dalkescientific.com> wrote:
Me [Andrew Dalke] said:
The relevant code in stringobject uses PySequence_Fast_GET_ITEM(seq, i), which likely doesn't know about my derived __getitem__.
Oops, I didn't know what the code was doing well enough. The relevant problem is
seq = PySequence_Fast(orig, "");
That calls __iter__ on my derived list object, which knows nothing about my overridden __getitem__
Put another way, the problem is related to your initial claim:
I can derive from list and override __getitem__
You can do that, but you should not. It's almost a bug that you can. Jeremy
So things are working as designed.
Well, back to blundering about. Too much brennivin. ;)
Andrew dalke@dalkescientific.com
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/jeremy%40alum.mit.edu