[Python-Dev] PEP 362: 4th edition (original) (raw)
Yury Selivanov yselivanov.ml at gmail.com
Tue Jun 19 03:33:54 CEST 2012
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2012-06-18, at 9:29 PM, Nick Coghlan wrote:
On Tue, Jun 19, 2012 at 7:06 AM, Jim Jewett <jimjjewett at gmail.com> wrote:
Correct; it should be redundant. Signature.kwargsparameter should be the same object that occurs as the nth element of Signature.parameters.values(). It is just more convenient to retrieve the parameter directly than it is to iterate through a collection inspecting each element for the value of a specific attribute. I suspect in 3.4 we will add the following additional convenience properties: Signature.positional -> list[Parameter] List of POSITIONALONLY and KEYWORDORPOSITIONAL parameters Signature.varpositional -> None or Parameter Reference to the VARPOSITIONAL parameter, if any Signature.keyword -> dict{name:Parameter} Mapping of all KEYWORDONLY and KEYWORDORPOSITIONAL parameters Signature.varkeyword -> None or Parameter Reference to the VARKEYWORD parameter, if any
Maybe. But I'd suggest to avoid the intersection of 'Signature.positional' and 'Signature.keyword'. Better to have 'Signature.keywordonly'.
However, I don't think we should add such convenience properties right now. One step at a time.
+1. 'Signature.parameters' seems to be enough right now.
- Yury
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]