A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-February/060616.html below:

[Python-Dev] Let's just *keep* lambda

[Python-Dev] Let's just *keep* lambda [Python-Dev] Let's just *keep* lambda"Martin v. Löwis" martin at v.loewis.de
Thu Feb 9 17:39:31 CET 2006
Jiwon Seo wrote:
> Apparently, simplest example is,
> 
> collection.visit(lambda x: print x)

Ok. I remotely recall Guido suggesting that print should become
a function.

It's not a specific example though: what precise library provides
the visit method?

> which currently is not possible. Another example is,
> 
> map(lambda x: if odd(x): return 1
>                       else: return 0,
>         listOfNumbers)

Hmm. What's wrong with

map(odd, listOfNumbers)

or, if you really need ints:

map(lambda x:int(odd(x)), listOfNumbers)

> Also, anything with exception handling code can't be without explicit
> function definition.
> 
> collection.visit(lambda x: try: foo(x); except SomeError: error("error
> message"))

That's not a specific example.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4