Skip to content

Two fields in inspect.FullArgSpec mis-annotated #3361

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

Closed
arnimarj opened this issue Oct 14, 2019 · 2 comments · Fixed by #3362
Closed

Two fields in inspect.FullArgSpec mis-annotated #3361

arnimarj opened this issue Oct 14, 2019 · 2 comments · Fixed by #3362
Labels
stubs: false negative Type checkers do not report an error, but should

Comments

@arnimarj
Copy link
Contributor

Hi,

It seems that two fields in inspect.FullArgSpec are mis-annotated:

Looking at the implementation of getfullargspec, at the very end this happens:

    if not kwdefaults:
        # compatibility with 'func.__kwdefaults__'
        kwdefaults = None

    if not defaults:
        # compatibility with 'func.__defaults__'
        defaults = None

The two fields kwonlydefaults and defaults need to be Optional[]. This seems to be true for Python 3.4+:

@srittau srittau added size-small stubs: false negative Type checkers do not report an error, but should labels Oct 14, 2019
@srittau
Copy link
Collaborator

srittau commented Oct 14, 2019

PR welcome!

arnimarj added a commit to arnimarj/typeshed that referenced this issue Oct 14, 2019
@arnimarj
Copy link
Contributor Author

#3362 :)

srittau pushed a commit that referenced this issue Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false negative Type checkers do not report an error, but should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants