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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to