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 David MacIver
Recipients David MacIver
Date 2015-03-24.08:42:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427186549.72.0.114773126362.issue23757@psf.upfronthosting.co.za>
In-reply-to
Content
Converting a list to a tuple appears to have an optimisation that is wrong in the presence of subclassing to override __iter__. It ignores the user defined iter and uses the normal list one. I've attached a file with a test case to demonstrate this.

I've verified this on both python 2.7 and python 3.4. It's presumably also the case on everything in between.

This was found because it caused a bug with a type that pytz uses, which lazily populates the list on iteration: https://bugs.launchpad.net/pytz/+bug/1435617
History
Date User Action Args
2015-03-24 08:42:29David MacIversetrecipients: + David MacIver
2015-03-24 08:42:29David MacIversetmessageid: <1427186549.72.0.114773126362.issue23757@psf.upfronthosting.co.za>
2015-03-24 08:42:29David MacIverlinkissue23757 messages
2015-03-24 08:42:29David MacIvercreate