New submission from Mark Bell:

The built-in function sum takes an optional argument "start" to specify what 
value to start adding from (defaults to 0). This argument should be a keyword 
argument in order to match the other built-in functions such as:

    enumerate(range(10), start=5)

This patch allows users to write:

    sum(range(10), start=5)

which previously raised "TypeError: sum() takes no keyword arguments". Since 
the only change is making an optional positional argument into a keyword 
argument, this has no effect on any existing code using the current convention 
of:

    sum(range(10), 5)

----------
components: ctypes
messages: 299908
nosy: Mark.Bell
priority: normal
severity: normal
status: open
title: Start should be a keyword argument of the built-in sum
versions: Python 2.7, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31141>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to