On 2012-06-18, at 9:29 PM, Nick Coghlan wrote:

> On Tue, Jun 19, 2012 at 7:06 AM, Jim Jewett <jimjjew...@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 POSITIONAL_ONLY and KEYWORD_OR_POSITIONAL parameters
> Signature.var_positional -> None or Parameter
>    Reference to the VAR_POSITIONAL parameter, if any
> Signature.keyword -> dict{name:Parameter}
>    Mapping of all KEYWORD_ONLY and KEYWORD_OR_POSITIONAL parameters
> Signature.var_keyword -> None or Parameter
>    Reference to the VAR_KEYWORD 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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to