Yury Selivanov added the comment:
OK, I'm closing this one.
--
resolution: - rejected
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24189
___
Yury Selivanov added the comment:
Do you have any good use case for this?
In one of the first iterations of PEP 362 we had Parameter.index. However, we
later redesigned the object to work as a building block -- immutable, and
explicitly detached from its parent Signature. This way there is
Yury Selivanov added the comment:
What do you mean? In Signature or in BoundArguments? I would hope that
Signature keeps it.
I mean during the actual call, as **kwargs aren't ordered.
I think having indexes for parameters would make sense for a language like JS
or C, where there are no
Antoine Pitrou added the comment:
Le 14/05/2015 17:40, Yury Selivanov a écrit :
Do you have any good use case for this?
Passing a parameter around without having to pass the index separately :-)
In one of the first iterations of PEP 362 we had Parameter.index.
However, we later redesigned
Yury Selivanov added the comment:
As mentioned in the issue, when re-implementing function calls, you have
to flatten the arguments into a simple argument list [..]
Then you probably need indexes for BoundArguments, not Parameters.
(*) at least for pure Python functions, where the arguments
Antoine Pitrou added the comment:
Le 14/05/2015 17:49, Yury Selivanov a écrit :
What do you mean? In Signature or in BoundArguments? I would hope
that
Signature keeps it.
I mean during the actual call, as **kwargs aren't ordered.
I think having indexes for parameters would make sense
Antoine Pitrou added the comment:
Given the drawback you mentioned above, I agree that this may be a hard sell :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24189
___
New submission from Antoine Pitrou:
A signature Parameter object only exposes its name, not its index in the
signature. I think that would be a useful information to have.
--
components: Library (Lib)
messages: 243166
nosy: pitrou, yselivanov
priority: normal
severity: normal
status: