Skip to content

No error when mutating ParamSpec **kwargs#16157

@kmurphy4

Description

@kmurphy4

Bug Report

Even though it fails at runtime, mypy doesn't complain if I mutate ParamSpec.kwargs.

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.11&gist=f5cea6637a9ea13c48b8ba75aa8d73dd

If I run this same code in an interpreter, I get

Traceback (mostrecentcalllast): File"/tmp/repro.py", line16, in<module>print(bar(foo)) File"/tmp/repro.py", line13, inbarreturnf(*args, **kwargs) TypeError: foo() gotanunexpectedkeywordargument'ka'

Expected Behavior

I would expect this to trigger an error on line 12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-paramspecPEP 612, ParamSpec, Concatenate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions