[issue14451] sum, min, max only works with iterable
report at bugs.python.org
Fri Mar 30 12:18:26 CEST 2012
New submission from Fade78 <fade at wanadoo.fr>:
The built-in functions working with iterable should also work with single object that is relevent.
max([1,6,5]) -> 6
max(6) -> TypeError because not an iterable (actual behavior)
max(6) -> 6 (wanted pythonic behavior)
So if I write a generic function like this:
it fails if x is not an iterable. But I want the argument to be anything possible. Using if(type) to separate use cases is not very pythonic.
title: sum, min, max only works with iterable
versions: Python 3.2
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list