[Python-Dev] PySequence_Fast_GET_ITEM in string join (original) (raw)
Jeremy Hylton jeremy at alum.mit.edu
Wed May 24 17:37:27 CEST 2006
- Previous message: [Python-Dev] PySequence_Fast_GET_ITEM in string join
- Next message: [Python-Dev] SSH key for work computer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 5/23/06, Andrew Dalke <dalke at dalkescientific.com> wrote:
Me [Andrew Dalke] said: > The relevant code in stringobject uses PySequenceFastGETITEM(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 = PySequenceFast(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 at dalkescientific.com
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/jeremy%40alum.mit.edu
- Previous message: [Python-Dev] PySequence_Fast_GET_ITEM in string join
- Next message: [Python-Dev] SSH key for work computer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]