[Python-ideas] [Python-Dev] minmax() function returning (minimum, maximum) tuple of a sequence (original) (raw)
Raymond Hettinger raymond.hettinger at gmail.com
Mon Oct 25 23:11:26 CEST 2010
- Previous message: [Python-ideas] [Python-Dev] minmax() function returning (minimum, maximum) tuple of a sequence
- Next message: [Python-ideas] [Python-Dev] minmax() function returning (minimum, maximum) tuple of a sequence
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is it possible to calculate min(items) and max(items) simultaneously using generators? I don't see how... No, this is why the reduce-like approach is better for such cases. Otherwise you keep trying to fit a square peg into a round hold.
Which, of course, is neither good for the peg, nor for the hole ;-)
no-square-pegs-in-round-holes-ly yours,
Raymond
- Previous message: [Python-ideas] [Python-Dev] minmax() function returning (minimum, maximum) tuple of a sequence
- Next message: [Python-ideas] [Python-Dev] minmax() function returning (minimum, maximum) tuple of a sequence
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]