Skip to content

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

@truenicoco

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.

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