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

Carl M. Johnson cmjohnson.mailinglist at gmail.com
Thu Oct 13 06:45:26 CEST 2011


I really like the proposal, although I would be interested to see if anyone can bikeshed up keywords that might be better than : or @… :-) 

I do have some questions about it. Does using @ instead of the name defined below make the implementation easier? In other words, would this cause a NameError on normalize because normalize isn't defined in the local namespace?--

:sorted_list = sorted(original, key=normalize)
def normalize(item):
   …

Or is the @ just for brevity? I assume the point is that it's not just brevity, but you have to use the @ in order to make the implementation straightforward.

-- Carl Johnson 


More information about the Python-ideas mailing list