For review: PEP 308 - If-then-else expression
Roman Suzi
rnd at onego.ru
Sun Feb 9 12:22:44 EST 2003
:-))))
I've just proposed ! instead of |
Is noosphere a reality?
I think you agree that ! is more apropriate for lambda's?
On Sun, 9 Feb 2003, Jack Diederich wrote:
>On Sat, Feb 08, 2003 at 04:39:30PM -0800, Paul Rubin wrote:
>> "Paul Paterson" <hamonlypaulpaterson at houston.rr.com> writes:
>> How about further abuse of colon:
>>
>> f(:expression)
>>
>> is short for f(lambda: expression)
>
>I was actually thinking about this yesterday, but with pipes
>
>new traditional
>||foo labmda:foo
>|x|foo lambda x:foo
>
>IMO this make lambdas more readable, and list comprehensions could DIE
>map and filters using lambdas would be more readable, and even shorter
>than list comps in plain situations
>
>l = [x.guy for (x) in blah]
>l = map(|x|x.guy, blah)
>
>l = [x.guy for (x) in blah if x.guy < 7]
>l = map(|x|x.guy, filter(|x|x.guy < 7, blah))
>
>-jackdied
>
>
Sincerely yours, Roman Suzi
--
rnd at onego.ru =\= My AI powered by Linux RedHat 7.3
More information about the Python-list
mailing list