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 gvanrossum
Recipients John.McDonald, Mariatta, ajaksu2, charettes, georg.brandl, gvanrossum, kaizhu, levkivskyi, serhiy.storchaka
Date 2018-05-07.15:30:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAP7+vJ+QWfk1AR6T1Qn0bNCcfLa8S1_QLCcoiEFT1=sApsc_BQ@mail.gmail.com>
In-reply-to <1525702154.59.0.682650639539.issue3692@psf.upfronthosting.co.za>
Content
> I don't think this will need drastic changes.

IIRC LOAD_NAME loads from the *local* scope, which will be the synthetic
function created for the comprehension (whose scope contains the loop
control variables). We may need a new opcode similar to LOAD_GLOBAL that
looks in two non-local directories rather than just one before falling back
to builtins; and the function object would need to have a link to both the
class dict and the global dict -- currently function objects gave a
__globals__ link but there's no chaining. Or perhaps __globals__ could be
set to a chainmap referencing the class dict and the globals?
History
Date User Action Args
2018-05-07 15:30:27gvanrossumsetrecipients: + gvanrossum, georg.brandl, ajaksu2, kaizhu, serhiy.storchaka, John.McDonald, charettes, levkivskyi, Mariatta
2018-05-07 15:30:27gvanrossumlinkissue3692 messages
2018-05-07 15:30:27gvanrossumcreate