[Python-ideas] Where-statement (Proposal for function expressions)

Chris Perkins chrisperkins99 at gmail.com
Thu Jul 16 19:02:20 CEST 2009


On Thu, Jul 16, 2009 at 12:51 PM, Jan Kaliszewski<zuo at chopin.edu.pl> wrote:
>> How about the following as additional syntactic sugar for the common
>> one-function case?
>> x = blah(f) where def f(item):
>>   body_of_f
>
> +1 from me also.
>

I'm not sold on that one yet, only because someone is inevitably going
to ask why they can't create a singleton-ish sort of thing like this:

thing = Thing() where class Thing(object):
    def __init__(...): etc

Or maybe that should be allowed too?


Chris Perkins



More information about the Python-ideas mailing list