[New-bugs-announce] [issue25628] Make namedtuple "verbose" and "renanme" parameters into keyword only arguments

Raymond Hettinger report at bugs.python.org
Sun Nov 15 14:21:13 EST 2015


New submission from Raymond Hettinger:

This is a usability and readability improvement made possible by Python 3's keyword only arguments.

Usability is improved by getting a much less confusing response from the following mistake:

    namedtuple('Point', 'x', 'y')
                              ^--- invisibly goes to the "verbose" argument 

The "verbose" argument is normally used interactively (much like help() and dis()) or is used with a keyword argument, so it is unlikely that existing scripts will be much affected.  For the rare cases, the remediation is simple and improves code clarity (replacing "True" with "verbose=True").

----------
components: Library (Lib)
files: namedtuple_keywords.diff
keywords: patch
messages: 254689
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Make namedtuple "verbose" and "renanme" parameters into keyword only arguments
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41049/namedtuple_keywords.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25628>
_______________________________________


More information about the New-bugs-announce mailing list