This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make all switches keyword-only
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, loewis, ptn, r.david.murray, rhettinger
Priority: normal Keywords:

Created on 2009-06-29 15:21 by ptn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg89850 - (view) Author: Pablo Torres Navarrete (ptn) Date: 2009-06-29 15:21
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.
msg89851 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-06-29 15:29
I suspect it would require a PEP, since it would mean breaking backward
compatibility in a rather extensive fashion.  I suggest floating this
idea on python-ideas first for feedback.
msg89861 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-06-29 16:33
Closing this for now; it really needs some serious discussion so a
tracker item is not appropriate.
msg89869 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-06-29 18:12
Let me get this right, you don't like it when people use positional
arguments for options and switches.  So, you want to force them to
change to a style you do like by breaking their existing code.  And once
they've changed, their code will be slower, more verbose, and won't work
with a star-args calling pattern. 

I think your odds of success are slim.
msg89878 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-06-29 21:14
Just to add another voice: I would be opposed if such breakage is added
before Python 4.
msg89893 - (view) Author: Pablo Torres Navarrete (ptn) Date: 2009-06-29 22:54
OK, bad idea it is then.  Thank you for your time.
History
Date User Action Args
2022-04-11 14:56:50adminsetgithub: 50621
2009-06-29 22:54:43ptnsetmessages: + msg89893
2009-06-29 21:14:03loewissetnosy: + loewis
messages: + msg89878
2009-06-29 18:12:21rhettingersetnosy: + rhettinger
messages: + msg89869
2009-06-29 16:33:26georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg89861

resolution: wont fix
2009-06-29 15:29:59r.david.murraysetnosy: + r.david.murray
messages: + msg89851
2009-06-29 15:21:02ptncreate