This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients brett.cannon, larry, pitrou, yselivanov
Date 2015-05-14.15:40:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431618044.08.0.216462030076.issue24189@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-05-14 15:40:44yselivanovsetrecipients: + yselivanov, brett.cannon, pitrou, larry
2015-05-14 15:40:44yselivanovsetmessageid: <1431618044.08.0.216462030076.issue24189@psf.upfronthosting.co.za>
2015-05-14 15:40:44yselivanovlinkissue24189 messages
2015-05-14 15:40:43yselivanovcreate