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

Nick Coghlan ncoghlan at gmail.com
Thu Sep 29 14:05:12 CEST 2011

On Wed, Sep 28, 2011 at 11:58 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 28 September 2011 16:38, Guido van Rossum <guido at python.org> wrote:
>> Of course once there's different syntax, the nonlocal declaration in
>> the function is redundant. And clearly I'm back-peddling. :-)
> If we're back to syntax proposals on the def statement, how about
> def fn() with i=1, lock=Lock():
>   whatever
> ? This is basically another bikeshed to paint, though...

The PEP 3150 discussion on keywords is relevant to that kind of
keyword-based proposal (there's a reason the statement local
namespaces proposal suggests 'given' rather than 'with' or 'where')


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list