Skip to content

Ignoring error does not work for "Unexpected keyword argument" #6807

@serhiy-storchaka

Description

@serhiy-storchaka

# typing: ignore is a way to ignore MyPy errors. But it does not work for the "Unexpected keyword argument" error. So I cannot silence errors in typeshed (see python/typeshed#2976).

$ cat a.py
def foo() -> None:
    pass

foo(a=1)  # typing: ignore

$ mypy a.py
a.py:1: note: "foo" defined here
a.py:4: error: Unexpected keyword argument "a" for "foo"

$ mypy --version
mypy 0.701

Is there other workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions