[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
superseder:  -> Make *start* usable as a keyword argument for sum().

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Stefan Behnel


Stefan Behnel  added the comment:

Yes, duplicate of issue34637.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this about sum not accepting start as keyword argument? It's fixed with 
issue34637. The help function in the report is that start could only be a 
positional argument with start appearing before '/' in "sum(iterable, start=0, 
/)" . This has been changed in 3.8 to below signature.

sum(iterable, /, start=0)
Return the sum of a 'start' value (default: 0) plus an iterable of numbers

When the iterable is empty, return the start value.
This function is intended specifically for use with numeric values and may
reject non-numeric types.

$ python3.7
Python 3.7.1rc2 (v3.7.1rc2:6c06ef7dc3, Oct 13 2018, 05:10:29)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> sum(range(10), start=10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: sum() takes no keyword arguments

# 3.8

$ ./python.exe
Python 3.8.0a3+ (heads/master:7444daada1, Mar 30 2019, 20:27:47)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> sum(range(10), start=10)
55

--
nosy: +rhettinger, xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Stefan Behnel


Stefan Behnel  added the comment:

It's currently implemented as a positional argument, not a keyword argument. 
Thus the "/" at the end of the signature in the help text. That also suggests 
that it was a conscious decision, not an oversight. Personally, I'd also prefer 
it if it was available as a keyword argument.

--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-31 Thread Camion


New submission from Camion :

>>> help(sum)
Help on built-in function sum in module builtins:

sum(iterable, start=0, /)
Return the sum of a 'start' value (default: 0) plus an iterable of numbers

When the iterable is empty, return the start value.
This function is intended specifically for use with numeric values and may
reject non-numeric types.

>>> sum([1, 2, 3], start=3)
Traceback (most recent call last):
  File "", line 1, in 
sum([1, 2, 3], start=3)
TypeError: sum() takes no keyword arguments

By the way, it is very annoying that the start value is not available, because 
it hampers the possibility to use sum with things like vectors.

--
components: Interpreter Core
messages: 339245
nosy: Camion
priority: normal
severity: normal
status: open
title: sum function's start optional parameter documented in help but not 
implemented
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com