Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor error in sum() docs #44368

Closed
kjohnson mannequin opened this issue Dec 20, 2006 · 2 comments
Closed

Minor error in sum() docs #44368

kjohnson mannequin opened this issue Dec 20, 2006 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@kjohnson
Copy link
Mannequin

kjohnson mannequin commented Dec 20, 2006

BPO 1619674
Nosy @akuchling

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/akuchling'
closed_at = <Date 2006-12-20.20:12:13.000>
created_at = <Date 2006-12-20.19:10:05.000>
labels = ['docs']
title = 'Minor error in sum() docs'
updated_at = <Date 2006-12-20.20:12:13.000>
user = 'https://bugs.python.org/kjohnson'

bugs.python.org fields:

activity = <Date 2006-12-20.20:12:13.000>
actor = 'akuchling'
assignee = 'akuchling'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2006-12-20.19:10:05.000>
creator = 'kjohnson'
dependencies = []
files = []
hgrepos = []
issue_num = 1619674
keywords = []
message_count = 2.0
messages = ['30847', '30848']
nosy_count = 2.0
nosy_names = ['akuchling', 'kjohnson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1619674'
versions = ['Python 2.5']

@kjohnson
Copy link
Mannequin Author

kjohnson mannequin commented Dec 20, 2006

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...

@kjohnson kjohnson mannequin closed this as completed Dec 20, 2006
@kjohnson kjohnson mannequin assigned akuchling Dec 20, 2006
@kjohnson kjohnson mannequin added the docs Documentation in the Doc dir label Dec 20, 2006
@kjohnson kjohnson mannequin closed this as completed Dec 20, 2006
@kjohnson kjohnson mannequin assigned akuchling Dec 20, 2006
@kjohnson kjohnson mannequin added the docs Documentation in the Doc dir label Dec 20, 2006
@akuchling
Copy link
Member

Thanks for pointing this out; I've changed the description of sum in rev. 53112.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant