This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Minor error in sum() docs
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, kjohnson
Priority: normal Keywords:

Created on 2006-12-20 19:10 by kjohnson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30847 - (view) Author: Kent Johnson (kjohnson) * Date: 2006-12-20 19:10
In 2.1 Built-in Functions, the docs for sum() say it takes a sequence argument. IIUC the actual requirement is for an iterable which is a weaker requirement than a sequence. For example the argument can be a generator expression or a dict, neither of which is a sequence. Also there is a missing 'a' in the fourth sentence. 

Here is a suggested rewrite:

sum(iterable[, start])
    Sums start and the items of an iterable, from left to right, and returns the total. start defaults to 0. The iterable's items are normally numbers, and are not allowed to be strings. The fast, correct way to concatenate a sequence of strings...
msg30848 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-12-20 20:12
Thanks for pointing this out; I've changed the description of sum in rev. 53112.

History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44368
2006-12-20 19:10:05kjohnsoncreate