**Bug Report** I face issues, when using ParamSpec.args as a tuple and ParamSpec.kwargs as a dict **To Reproduce** Execute mypy on the following code ```python from typing_extensions import ParamSpec from typing import Callable P = ParamSpec("P") def foo(func: Callable[P, None]): def _inner(*args: P.args, **kwargs: P.kwargs): x = kwargs.pop("x") ``` **Expected Behavior** It works **Actual Behavior** Error: `test.py:8:13: error: "P.kwargs" has no attribute "pop" [attr-defined]` **Your Environment** - Mypy version used: 0.941 - Mypy command-line flags: none - Mypy configuration options from `mypy.ini` (and other config files): none - Python version used: 3.7.1 - Operating system and version: Linux
Activity
AlexWaygood commentedon Apr 24, 2022
I just closed #12660 as a duplicate. Here's the repro from that issue, by @rbroderi:
Playground link: https://mypy-play.net/?mypy=latest&python=3.10&gist=52d9dbf3999e25e8a72c3bb20c1cb097
Use tuple[object, ...] and dict[str, object] as upper bounds for Para…
svenpanne commentedon Aug 23, 2022
I don't think that this is fully fixed, a slight variation using destructuring doesn't work:
See https://mypy-play.net/?mypy=latest&python=3.10&gist=0c605f87eb31c12b25c7da8f7c2819cd. You get the error:
main.py:8: error: "P.args" object is not iterable. The really funny thing is that looping withfor x in argsworks. Can you re-open this ticket?AlexWaygood commentedon Aug 23, 2022
@svenpanne, I fixed that just the other day in #13459. It'll be included in the next mypy release (0.980).