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.

Author ronaldoussoren
Recipients docs@python, marco.buttu, r.david.murray, ronaldoussoren
Date 2013-07-10.14:04:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1373465082.73.0.180468151718.issue18424@psf.upfronthosting.co.za>
In-reply-to
Content
There's an annoyingly long discussion about sum() on python-ideas.

IMHO the documentation should mention, as it does now, that sum is intended to be used with a sequence of numbers even it does work with most objects that support the + operator (such as by implementing __add__). In particular, using sum with a sequence of lists or tuples is extremely inefficient.

The fact that sum({1:'a', 2: 'b'}) works is a side effect of the how python works with sequences and IMHO doesn't have to be documented in every function that accepts a sequence as an argument.
History
Date User Action Args
2013-07-10 14:04:42ronaldoussorensetrecipients: + ronaldoussoren, r.david.murray, docs@python, marco.buttu
2013-07-10 14:04:42ronaldoussorensetmessageid: <1373465082.73.0.180468151718.issue18424@psf.upfronthosting.co.za>
2013-07-10 14:04:42ronaldoussorenlinkissue18424 messages
2013-07-10 14:04:42ronaldoussorencreate