[Python-ideas] Assignments in list/generator expressions

Guido van Rossum guido at python.org
Mon Apr 11 05:10:27 CEST 2011


On Sun, Apr 10, 2011 at 7:33 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Mon, Apr 11, 2011 at 8:48 AM, Guido van Rossum <guido at python.org> wrote:
>> FWIW, I don't mind if an implementation of this (or anything new,
>> really) doesn't work well with locals().
>
> While supporting locals() correctly is a bit of a pain, I find "Does
> read access to locals() still work?" to be a useful proxy for "Will
> proposing this feature have authors of Python debugging tools massing
> outside my front door with pitchforks and torches?" :)

Maybe, but debugger may be given access to things that regular code
does not, and if it has to work a little harder to get at the values
of local variables that is okay in my book. So I'd rather see the
actual question asked ("how can a debugger make sense of this") than a
proxy for that question. (And sure, if it's easy to make it work with
locals(), I am not objecting. :-)

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list