[Python-Dev] pep 362 - 5th edition

Yury Selivanov yselivanov at gmail.com
Wed Jun 20 04:15:04 CEST 2012


On 2012-06-19, at 10:06 PM, Nick Coghlan wrote:

> On Wed, Jun 20, 2012 at 11:29 AM, Yury Selivanov <yselivanov at gmail.com> wrote:
>> On 2012-06-19, at 9:22 PM, Yury Selivanov wrote:
>> 
>>> On 2012-06-19, at 8:39 PM, Nick Coghlan wrote:
>>> 
>>>> 2. The constructor for Parameter objects should require that names for
>>>> positional-only parameters start with "<" and end with ">" to ensure
>>>> they can always be distinguished from standard parameters in signature
>>>> string representations and in BoundArguments.parameters
>>> 
>>> +1
>> 
>> Actually, can we just make positional-only parameters to render brackets
>> in their/Signature's __str__ methods?  I think Parameter.kind should be
>> enough, without adding additional obstacles.
> 
> True, the check for name clashes in Signature (and the implied numeric
> "names") will cover the BoundArguments.parameters case

Nick, I also would like to keep Parameter.name being required.
I understand that *currently* we have no parameter names specified
for builtin methods, but we don't have any mechanisms to introspect
them too.

Now, in 3.3 (I hope) we introduce a brand new mechanism, and, probably, in
3.4 we have way to define Signatures for builtins.  Why not do it right?
This whole positional-only case is just a weird anachronism of CPython.

-
Yury


More information about the Python-Dev mailing list