[Python-ideas] Before and after the colon in function defs.
barry at python.org
Fri Sep 23 05:51:38 CEST 2011
On Sep 23, 2011, at 11:11 AM, Nick Coghlan wrote:
> def f(x):
> nonlocal i=i # Use 'f' as a closure over *itself*
> return x + i
Interestingly, PEP 3104 proposes that syntax, as shorthand for
nonlocal x; x = 3
though this was not adopted. I think your proposal is a very interesting,
modest but useful extension of that original PEP.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the Python-ideas