<p><br>
On Jun 7, 2012 3:11 AM, "Steven D&apos;Aprano" <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br>
><br>
> Larry Hastings wrote:<br>
><br>
>>> [...]<br>
>>> "Changes to the Signature object, or to any of its data members,<br>
>>> do not affect the function itself."<br>
>>><br>
>>> which leaves the possibility that __signature__ may no longer match the actual argument spec, for some reason. If you remove getfullargspec, people will have to reinvent it to deal with such cases.<br>
>><br>
>><br>
>> There's no reason why they should disagree. The "some reason" would be if some doorknob decided to change it--the objects are mutable, because there's no good reason to make them immutable.<br>
><br>
><br>
> Nevertheless, the world is full of doorknobs, and people will have to deal with their code.</p>
<p>Speaking as a doorknob, I plan to use this PEP to allow wrapper functions that accept arbitrary arguments to accurately report their signature as matching the underlying function. It will also be useful for allowing partial() objects (and other callables that tweak their API) to report an accurate signature.</p>
<p>For example, I believe bound methods will misrepresent their signature with the current PEP implementation - they actually should copy the function signature and then drop the first positional parameter. </p>
<p>However, these use cases would be easier to handle correctly with an explicit "copy()" method. </p>
<p>Also, +1 for keeping the lower level inspect functions around.</p>
<p>Cheers,<br>
Nick.</p>
<p>--<br>
Sent from my phone, thus the relative brevity :) </p>