Skip to content

Mypy v1.10.0 errors out when functools wraps a method #17166

Description

@davidbrochart

Bug Report

mypy v1.10.0 gives the following error, while it was working with v1.9.0:

test.py:13: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]

To Reproduce

# test.py

from functools import wraps

class Foo:
    def f(self):
        pass

class Bar:
    @wraps(Foo.f)
    def f(self):
        pass

bar = Bar()
bar.f()
mypy test.py

Expected Behavior

There should be no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions