[New-bugs-announce] [issue6372] Make all switches keyword-only

Pablo Torres Navarrete report at bugs.python.org
Mon Jun 29 17:21:04 CEST 2009


New submission from Pablo Torres Navarrete <tn.pablo at gmail.com>:

I propose that all formal parameters that really act as options/switches
be made keyword-only.  Examples of switches are all flags, timeouts,
'verbose' bools, maximums and minimums, etc.

This stresses the difference between needed input for a function and an
argument that changes/extends the behavior.  Besides, the code would be
more readable, because instead of having some cryptic function call like
register('Pablo Torres', 2, 4, 5, False) you would have the prettier
register('Pablo Torres', hour=2, min=4, sec=5, had_reservation=False).

The implementation would just require putting a star '*' before all
options, according to pep 3102.

If needed, I can rewrite this as a PEP.

----------
components: Library (Lib)
messages: 89850
nosy: ptn
severity: normal
status: open
title: Make all switches keyword-only
type: feature request
versions: Python 3.2

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


More information about the New-bugs-announce mailing list