Skip to content

Two fields in inspect.FullArgSpec mis-annotated #3361

Closed
@arnimarj

Description

@arnimarj

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+:

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: false negativeType checkers do not report an error, but should

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions