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 terry.reedy
Recipients bup, terry.reedy
Date 2017-02-25.22:50:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488063010.31.0.836502838682.issue29653@psf.upfronthosting.co.za>
In-reply-to
Content
We usually prefer diffs rather than revised files, but I know not everyone can provide them.  Did you change anything other than add the following?
    elif hasattr(ob, '__wrapped__') and callable(ob.__wrapped__):
        fob = ob.__wrapped__
 
I am all for accurate calltips.  However, your patch will not work for the stdlib wrapper functools.partial.  It does not add a __wrapped__ attribute.  Instead it had args, func, and kwargs attributes.

I plan on switching calltips from using inspect.getfullargspec to inspect.signature (#19903). The latter defaults to follow_wrapped=True, in which case, it should follow callable.__wrapped__.  https://docs.python.org/3/library/inspect.html#inspect.signature.  It also is documented to work with partials and in my test, it indeed followed .func to get the original signature and remove the parameters set in the partial call.

So this request is a duplicate in that it will be fixed by the existing issue.
History
Date User Action Args
2017-02-25 22:50:10terry.reedysetrecipients: + terry.reedy, bup
2017-02-25 22:50:10terry.reedysetmessageid: <1488063010.31.0.836502838682.issue29653@psf.upfronthosting.co.za>
2017-02-25 22:50:10terry.reedylinkissue29653 messages
2017-02-25 22:50:09terry.reedycreate