News for hackers. Stuff that matters.
Re:Why Python is Important for You by wging on Saturday February 11, 2012 @11:08PM (#3581073)
>Range class: [i for i in range(10)]

How does this differ from list(range(10)) (besides being highly suggestive of the power of list comprehensions)?

>IMHO the latter one is way more readable and generators cover almost all the use cases for lambdas. If you could not do it with a generator expression and choose to use a anonymous function it should have been a method anyway.

This is actually why Guido van Rossum wanted to remove lambda from the core language: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 (He didn't, thankfully. I still want reduce back in 3.x, though.)

There are no comments on this comment yet.