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 nothing wrong 
in taking a parameters from one signature, and using them to build a new one.  
And since (I think) I'm doing this kind of things in my own code, adding this 
attribute (or even reference to the parent Signature) to Parameter might break 
things, or even introduce strange side effects.

Another reason is that we don't preserve the order of keyword arguments.  And 
having things like '*args' further disconnects parameters indexes from 
arguments indexes.

We can add an 'index(name)' or 'index(param)' method to the Signature class, 
but I don't know any good use case why would we need that.

----------
nosy: +brett.cannon, larry

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24189>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to