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.

classification
Title: Document inspect.get(full)argspec limitation to Python function
Type: Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: brett.cannon, georg.brandl, terry.reedy
Priority: normal Keywords:

Created on 2009-12-01 21:38 by terry.reedy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg95879 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-12-01 21:38
"inspect.getargspec(func) 
Get the names and default values of a function’s arguments. "
"inspect.getfullargspec(func) 
Get the names and default values of a function’s arguments."

'Function' must be a Python function (or a bound method wrapper
thereof). (Some posted this 'discovery' on python-list today, so it is
not obvious to everyone.)

Suggestion: insert 'Python' before "function's"
or rewrite as
"Get the names and default values of the arguments of a Python function
or bound method."

This is a different request from #1748064, which requested that the
limitation be removed.
msg95889 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-12-02 00:57
Just in case anyone else gets confused, Terry's desire for the 
clarification is that getargspec() won't work with functions originating 
from an extension module.
msg95893 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-12-02 02:16
Sorry, you confuse me a bit. get(full)argspec also does not work with
builtins. I am asking that the doc be clarified to match behavior so
that people are not surprised by
TypeError: arg is not a Python function
as in written in Python versus C.
msg95896 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-12-02 07:33
That's basically what I said.
msg97450 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-01-09 09:48
Thanks, added "Python" in r77382, r77383.
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51671
2010-01-09 09:48:52georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg97450
2009-12-02 07:33:00brett.cannonsetmessages: + msg95896
2009-12-02 02:16:51terry.reedysetmessages: + msg95893
2009-12-02 00:57:27brett.cannonsetnosy: + brett.cannon
messages: + msg95889
2009-12-01 21:38:12terry.reedycreate