Minimum and Maximum of a list containing floating point numbers

Ben Finney ben+python at benfinney.id.au
Tue Sep 7 00:20:43 EDT 2010


Steven D'Aprano <steve-REMOVE-THIS at cybersource.com.au> writes:

> Of course, list comps are so seductively easy, and functional
> programming so conceptually different from what many people are used
> to, that such over-specification is an awfully easy trap to fall into.
> I'm sure my own code is filled with similar examples where I use a
> list comp where a map is more suitable.

Right. I find list comprehensions and generator expressions easy both to
write and to read.

So I prefer them, and often don't consider more function-based
approaches. I don't think my code (nor my examples) suffer much as a
result.

-- 
 \          “Rightful liberty is unobstructed action, according to our |
  `\        will, within limits drawn around us by the equal rights of |
_o__)                                       others.” —Thomas Jefferson |
Ben Finney



More information about the Python-list mailing list