[Python-ideas] Statement local functions and classes (aka PEP 3150 is dead, say 'Hi!' to PEP 403)

Eric Snow ericsnowcurrently at gmail.com
Thu Oct 13 08:37:11 CEST 2011


On Thu, Oct 13, 2011 at 12:30 AM, Carl M. Johnson
<cmjohnson.mailinglist at gmail.com> wrote:
>
> On Oct 12, 2011, at 8:24 PM, Ka-Ping Yee wrote:
>
>> I don't see why the leading colon is necessary, actually.  Isn't
>> the presence of a bare @ enough to signal that a function or class
>> definition must come next?
>
> Python's parser is purposefully pretty simple, so it's not clear if that could be added without ripping up the whole language definition.

and visually the colon _does_ make the syntax clearer.  It works
because it's so out of place at the beginning of a line.  Scanning
through code you won't miss it (and misinterpret what's going on).

-eric

> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list