classification
Title: Changing the signature for Parameter's constructor
Type: Stage:
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee, r.david.murray, yselivanov
Priority: normal Keywords: patch

Created on 2013-12-18 00:04 by Antony.Lee, last changed 2014-01-29 21:01 by yselivanov. This issue is now closed.

Files
File name Uploaded Description Edit
parameter-constructor.patch Antony.Lee, 2013-12-18 00:04
Messages (4)
msg206490 - (view) Author: Antony Lee (Antony.Lee) * Date: 2013-12-18 00:04
As suggested on python-ideas, this small patch changes the constructor of inspect.Parameter so that "kind" defaults to "POSITIONAL_OR_KEYWORD", which should make code that needs to construct Parameter objects slightly less verbose (as I believe POSITIONAL_OR_KEYWORD is likely the most common kind).
msg206512 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-12-18 12:35
Can you provide a link to the python-ideas discussion, please?
msg206543 - (view) Author: Antony Lee (Antony.Lee) * Date: 2013-12-18 17:33
Nobody replied so far...
https://mail.python.org/pipermail/python-ideas/2013-December/024538.html
msg209682 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2014-01-29 21:01
I don't think this is a good idea, as it would require those who read with the code to know about this default. Explicit is definitely better than implicit in this case.
History
Date User Action Args
2014-01-29 21:01:44yselivanovsetstatus: open -> closed

nosy: + yselivanov
messages: + msg209682

resolution: rejected
2013-12-18 17:33:00Antony.Leesetmessages: + msg206543
2013-12-18 12:35:14r.david.murraysetnosy: + r.david.murray
messages: + msg206512
2013-12-18 00:04:43Antony.Leecreate