Skip to content

Signature of decorated function is not type checked by mypy #504

Description

@truenicoco

The following has mypy (expectedly) failing with error: Argument 1 to "f1" has incompatible type "int"; expected "str" [arg-type]

async def f1(x: str, y: int) -> str:
    return x + str(y)


async def main():
    await f1(1, 1)

But decorating f1 with @alru_cache prevents mypy from detecting any issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions