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.
Created on 2017年02月25日 20:34 by bup, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| calltips.py | bup, 2017年02月25日 20:34 | |||
| Messages (2) | |||
|---|---|---|---|
| msg288580 - (view) | Author: Dan Snider (bup) * | Date: 2017年02月25日 20:34 | |
Many wrappers use the famous (*args, **kwargs) argspec, which is less than helpful for a function that uses some positional arguments and maybe a few keyword only arguments, ie (x, y, z=10). Other IDEs have the capability of showing the wrapped functions argspec in a calltip, so why shouldn't IDLE? |
|||
| msg288584 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2017年02月25日 22:50 | |
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 |
| 2022年04月11日 14:58:43 | admin | set | github: 73839 |
| 2017年02月25日 22:50:10 | terry.reedy | set | status: open -> closed superseder: Idle: Use inspect.signature for calltips messages: + msg288584 resolution: duplicate stage: resolved |
| 2017年02月25日 20:34:32 | bup | create | |