This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tromey
Recipients tromey
Date 2012-08-01.16:40:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343839231.18.0.262983756093.issue15529@psf.upfronthosting.co.za>
In-reply-to
Content
I was debugging this bug reported against gdb:

http://sourceware.org/bugzilla/show_bug.cgi?id=14386

It turns out that what went wrong in this code was that
PyIter_Check evaluates to 0 when its argument is a
Python list.

This happens because the PyIter_Check macro looks at the
tp_iternext field; but this field is 0 in PyList_Type.

I am not sure of the correct fix; but PyIter_Check is not
faithfully reflecting what PyObject_GetIter does.
Maybe it isn't intended to; but anyway it seems that
checking tp_iter would maybe be a better approximation.

Even if PyIter_Check remains as-is, I think it would be nice
if the documentation were more specific about what it
actually does.

FWIW I'm modifying gdb not to use this function.
History
Date User Action Args
2012-08-01 16:40:31tromeysetrecipients: + tromey
2012-08-01 16:40:31tromeysetmessageid: <1343839231.18.0.262983756093.issue15529@psf.upfronthosting.co.za>
2012-08-01 16:40:30tromeylinkissue15529 messages
2012-08-01 16:40:29tromeycreate