New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspect.getargspec(print) fails #51154
Comments
>>> import inspect
>>> inspect.getargspec(print)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "F:\Python31\lib\inspect.py", line 787, in getargspec
getfullargspec(func)
File "F:\Python31\lib\inspect.py", line 814, in getfullargspec
raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function Is this normal or a known issue? I couldn't find an existing ticket. |
This is not an issue, but a fundamental restriction of what getargspec() def func(*args) or def func(*args, **kwargs) and is free to do what it wants with the args and kwargs. |
You're right, I was confused by the statement "arg is not a Python After digging a bit into inspect.py, may I suggest line 814 be changed to: That way the error I would have received would have given: |
OK, that is reasonable. I changed this and several other same-style |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: