[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 10:28:01 CEST 2011


On Oct 12, 2011, at 9:32 PM, Eric Snow wrote:

> 
> 1. decorators
> 
> just to clarify, this is legal:
> 
>   :assert @(1) == 1
>   @lambda f: return lambda x: return x
>   def spam(): pass

Nitpicker's note: lambda as a decorator isn't legal today (although I argued in the past maybe it should be), and I don't think PEP 403 would change it, so that won't work. Nevertheless, this would be legal if I understand correctly:

_ = lambda arg: arg

:assert @(1) == 1
@_(lambda f: return lambda x: return x)
def spam(): pass




More information about the Python-ideas mailing list