Code block literals

Dave Benjamin dave at 3dex.com
Wed Oct 8 17:36:42 EDT 2003


Dave Benjamin wrote:

>  >>> print mylist.map({ |x| return x + 2 }, range(5))
> 0, 2, 4, 6, 8

Duh... sorry, that should read:
print range(5).map({ |x| return x + 2 })

(and yes, I realize a lambda would work here)

Dave





More information about the Python-list mailing list