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 daniel.urban
Recipients amaury.forgeotdarc, dangyogi, daniel.urban, hagen, kcarnold, terry.reedy
Date 2011-03-06.12:35:11
SpamBayes Score 4.3250107e-06
Marked as misclassified No
Message-id <1299414912.03.0.914367667615.issue4806@psf.upfronthosting.co.za>
In-reply-to
Content
I think the patch isn't entirely correct.  It uses PyIter_Check for detecting the case when an *iterable* raises TypeError, but that function actually checks for an *iterator*.  The check on the tp_iter member mentioned by Amaury Forgeot d'Arc probably would be better, but even that wouldn't detect every iterable: "Its presence normally signals that the instances of this type are iterable (although sequences may be iterable without this function)." (http://docs.python.org/dev/py3k/c-api/typeobj.html#PyTypeObject.tp_iter)  (Apparently any object with a __getitem__ is iterable.  By the way, collections.abc.Iterable also doesn't detect this case.)
History
Date User Action Args
2011-03-06 12:35:12daniel.urbansetrecipients: + daniel.urban, terry.reedy, amaury.forgeotdarc, dangyogi, hagen, kcarnold
2011-03-06 12:35:12daniel.urbansetmessageid: <1299414912.03.0.914367667615.issue4806@psf.upfronthosting.co.za>
2011-03-06 12:35:11daniel.urbanlinkissue4806 messages
2011-03-06 12:35:11daniel.urbancreate