[issue7447] Sum() doc and behavior mismatch

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Fixed in r86066, r86068 and r86069. -- resolution: - fixed status: open - closed versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: from_iterable() was marked up wrongly in the itertools docs; this is fixed now in r83230. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Leonhard Vogt
Changes by Leonhard Vogt leonhard.v...@gmx.ch: Removed file: http://bugs.python.org/file18223/functions.rst.patch4.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447 ___

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Leonhard Vogt
Leonhard Vogt leonhard.v...@gmx.ch added the comment: Thank you Georg, I updated the patch Ezio, wouldn't start=0 in the signature imply that sum accepted a keyword argument? I read Documenting Python (4.3) but am not sure about the distinction of default values or keyword arbuments.

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: The oldest interfaces tend to have quirks like that. Similar issue: #9379. Won't be changed as well. I'm thinking of a better docstring though. -- nosy: +lukasz.langa ___ Python tracker

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: For Python functions, all arguments can be keyword arguments. For many builtins, none can be (and maybe there should be a note to that effect at the top of the built-in functions chapter). 'Param = default' merely means that the parameter has

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: For Python functions, all arguments can be keyword arguments. For many builtins, none can be (and maybe there should be a note to that effect at the top of the built-in functions chapter). +1 Many Python users don't really grasp how builtins

[issue7447] Sum() doc and behavior mismatch

2010-07-29 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Please do. This issue comes up often enough on python-list. Make it a separate doc issue, which will be auto-assigned to d...@python and add me as nosy. -- ___ Python tracker rep...@bugs.python.org

[issue7447] Sum() doc and behavior mismatch

2010-07-28 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I am puzzled that the fake name 'itertools.itertools.chain.from_iterable' works better than the real name 'itertools.chain.from_iterable'. Some bug in the tool chain? -- ___ Python tracker

[issue7447] Sum() doc and behavior mismatch

2010-07-27 Thread Leonhard Vogt
Leonhard Vogt leonhard.v...@gmx.ch added the comment: another patch: - moved string case to first position, i think it's the most important. - reworded (shortened) list case. - wrapped for 80 caracter lines. still using itertools.itertools.chain.from_iterable as mentioned in previous message.

[issue7447] Sum() doc and behavior mismatch

2010-07-27 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: You could also use start=0 in the signature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447 ___

[issue7447] Sum() doc and behavior mismatch

2010-07-26 Thread Leonhard Vogt
Leonhard Vogt leonhard.v...@gmx.ch added the comment: Thank you. I think the specific list of list example is better for the sum documentation because lists support the + operator. I don't think that someone would consider using sum for chaining arbitrary iterables. What about a concise To

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447 ___

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: A nitpick: lol is a very well-known acronym and list of lists is not the expansion that first comes to mind. -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Leonard, that you for the patch, in particular, the list of hints. I think the first is good but overly specific. It also has an extra '.itertools' in the path. Now: ''' + - To concatenate a list of lists ``lol`` use

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Note that using `~itertools.chain.from_iterable` is equivalent to `from_iterable itertools.chain.from_iterable` and saves a repetition. -- ___ Python tracker rep...@bugs.python.org

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: In order to have a chance at 2.6.6rc, due out in a week, I hand-edited the patch, incorporating Georg's suggestion, and uploaded. I think it is ready to commit. Since this is not a critical doc fix, I am not marking it a blocker, but I still

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: FWIW, I like the new patch better, but still have a few nitpicks: - Starting a sentence with an argument name is a bit awkward because that makes a sentence that starts with a lower case letter. - There is an extra

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: patch3 incorporates all your suggestions. I verified the itertools hint: list(itertools.chain.from_iterable([[10],[1,2],['a']])) [10, 1, 2, 'a'] I think the hints are clear enough; anyone with more questions should follow the link to the

[issue7447] Sum() doc and behavior mismatch

2010-07-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I want to look at this more before it goes forward. The docs are roughly correct as-is. In a effort to make them precise, it is easy make them more confusing or at least a bit harder to understand the basic function of sum().

[issue7447] Sum() doc and behavior mismatch

2010-05-18 Thread Leonhard Vogt
Leonhard Vogt leonhard.v...@gmx.ch added the comment: I changed the documentation regarding string not allowed as start argument and performance I included the list concatenation with itertools.chain from http://groups.google.com/group/comp.lang.python/msg/33e764d0ac41826a patch is based on

[issue7447] Sum() doc and behavior mismatch

2009-12-07 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: There are also a couple more things that could be improved in the documentation of sum(): 1) add a note about the performance trap mentioned by Alex [1] 2) remove the reduce() example because, even if it's true for that particular example,

[issue7447] Sum() doc and behavior mismatch

2009-12-06 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: georg.brandl - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7447 ___

[issue7447] Sum() doc and behavior mismatch

2009-12-05 Thread Terry J. Reedy
New submission from Terry J. Reedy tjre...@udel.edu: 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 last sentence is not currently