[Python-ideas] Before and after the colon in function defs.

Barry Warsaw 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...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110922/638c6eaf/attachment.pgp>

More information about the Python-ideas mailing list