[Python-ideas] Tweaking closures and lexical scoping to include the function being defined

Guido van Rossum guido at python.org
Tue Sep 27 23:23:09 CEST 2011

On Tue, Sep 27, 2011 at 2:04 PM, Arnaud Delobelle <arnodel at gmail.com> wrote:
> On 27 September 2011 21:38, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> [...]
>> As I remember, the idea foundered because it was thought
>> too confusing to have an expression that was written
>> inside the function but evaluated outside of it. If
>> we're seriously considering the current proposal,
>> presumably we've gotten over that? Or is it still a
>> valid objection?
> I have been reading this thread from the start and FWIW, it's
> something that I have been feeling uncomfortable about.  I value the
> guarantee that no code in the body of a def statement is executed when
> the def statement itself is executed.  This proposal would break this
> guarantee.

That seems a guarantee made up specifically to prevent this proposal.
What benefit do you see from it?

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

More information about the Python-ideas mailing list