[Python-Dev] Re: anonymous blocks

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Tue Apr 19 22:14:16 CEST 2005


Guido van Rossum wrote:
>> What was your opinion on "where" as a lambda replacement?  i.e.
>> 
>> foo = bar(callback1, callback2) where:
>>      def callback1(x):
>>          print "hello, "
>>      def callback2(x):
>>          print "world!"
> 
> I don't recall seeing this proposed, but I might have -- I thought of
> pretty much exactly this syntax in the shower a few days ago.

Gee, the time machine again!

Lots of proposals on c.l.py base on the introduction of "expression
suites", that is, suites embedded in arbitrary expressions. My opinion
is that one will never find a suitable (;-) syntax, there's always the
question of where to put the code that follows the suite (and is part
of the same statement).

yours,
Reinhold

-- 
Mail address is perfectly valid!



More information about the Python-Dev mailing list