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 Eyk
Recipients David Eyk
Date 2016-10-11.21:38:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476221937.84.0.647969996739.issue28419@psf.upfronthosting.co.za>
In-reply-to
Content
I've discovered what appears to be a scoping bug in Python 3.5.1, where the class scope is not available inside a list comprehension defined in the class scope.

Attached is a simple example script, also available at the following gist:

https://gist.github.com/eykd/c63a7cf760a538ee8bc3828362ed12e3

As demonstrated, the script runs fine in Python 2.7.11, but fails in 3.5.1. I can't think of any good reason why the class scope wouldn't be available to the comprehension scope, but if there is a reason, I'm keen to know what it is!
History
Date User Action Args
2016-10-11 21:38:57David Eyksetrecipients: + David Eyk
2016-10-11 21:38:57David Eyksetmessageid: <1476221937.84.0.647969996739.issue28419@psf.upfronthosting.co.za>
2016-10-11 21:38:57David Eyklinkissue28419 messages
2016-10-11 21:38:57David Eykcreate