[issue23787] sum() function docstring lists arguments incorrectly

2015-03-29 Thread Valentine Sinitsyn
Valentine Sinitsyn added the comment: Seems like mentioning string was really a bad idea. They were only used as (poor) example, forget them if they are confusing in any way. In my understanding, any sequence in Python is iterable, bit not all iterables are sequences (correct me if I'm wrong

[issue23787] sum() function docstring lists arguments incorrectly

2015-03-27 Thread Valentine Sinitsyn
New submission from Valentine Sinitsyn: sum() function doctstring describes expected arguments as follows (Python 2.7.6): sum(...) sum(sequence[, start]) - value ... This implies sum() should accept str, unicode, list, tuple, bytearray, buffer, and xrange. However, you clearly can't use

[issue23787] sum() function docstring lists arguments incorrectly

2015-03-27 Thread Valentine Sinitsyn
Valentine Sinitsyn added the comment: Yes, strings aren't an issue. I only used them as an example. I came across this issue during code review, discussing if it is okay to pass generator expression to sum() (like sum(x*2 for x in xrange(5)) or is it better to convert it to the list first