Message243195
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. |
|
Date |
User |
Action |
Args |
2015-05-14 15:40:44 | yselivanov | set | recipients:
+ yselivanov, brett.cannon, pitrou, larry |
2015-05-14 15:40:44 | yselivanov | set | messageid: <1431618044.08.0.216462030076.issue24189@psf.upfronthosting.co.za> |
2015-05-14 15:40:44 | yselivanov | link | issue24189 messages |
2015-05-14 15:40:43 | yselivanov | create | |
|