"M.-A. Lemburg" wrote: > > ... > > Is it really necessary to have all the "code" inside the square > brackets ? That's what a list comprehension is! Check the defacto PEP: http://www.cosc.canterbury.ac.nz/~greg/python/listcomp/ I take it you are against list comprehensions. > I always thought of list comprehension as a fast way to > just throw together a list, not as a way to "program" the > list contents. IMHO, that should be done using explicit > statements in the way Skip describes above. > > I would be completely satisfied with e.g. [0..10], [0..10:2] > and [10..0]. Those are not list comprehensions but "range literals." Actually, the syntax we are using is [0:10], [0:10:2], [10:0]. I prefer dotdot, but Guido chose the colon a decade ago. -- Paul Prescod - Not encumbered by corporate consensus Simplicity does not precede complexity, but follows it. - http://www.cs.yale.edu/~perlis-alan/quotes.html
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