We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash Report Crash first introduced with the new plugin for functools.partial in #16939. /CC @hauntsaninja
functools.partial
Traceback
$ mypy test.py --show-traceback test.py:11: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build Please report a bug at https://github.com/python/mypy/issues version: 1.11.0+dev.10f18a82b612b6127659cd64aa60c10b9cc7a904 Traceback (most recent call last): ... File ".../mypy/plugins/functools.py", line 247, in partial_call_callback result = ctx.api.expr_checker.check_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../mypy/checkexpr.py", line 1554, in check_call return self.check_callable_call( ^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../mypy/checkexpr.py", line 1643, in check_callable_call callee = callee.with_unpacked_kwargs().with_normalized_var_args() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../mypy/types.py", line 2087, in with_unpacked_kwargs assert isinstance(last_type, TypedDictType) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError:
To Reproduce
from typing import TypedDict, Unpack from functools import partial class Data(TypedDict, total=False): a1: int def f(**kwargs: Unpack[Data]) -> None: ... def g(**kwargs: Unpack[Data]) -> None: partial(f, **kwargs)()
Your Environment
1.11.0+dev.10f18a82b612b6127659cd64aa60c10b9cc7a904
3.12
-- Changing the example slightly to add a second variable to Data results in new errors but the crash goes away.
Data
from typing import TypedDict, Unpack from functools import partial class Data(TypedDict, total=False): a1: int a2: int # <-- new def f(**kwargs: Unpack[Data]) -> None: ... def g(**kwargs: Unpack[Data]) -> None: partial(f, **kwargs)()
test.py:12: error: "f" gets multiple values for keyword argument "a1" [misc] test.py:12: error: "f" gets multiple values for keyword argument "a2" [misc]
The text was updated successfully, but these errors were encountered:
9012fc9
Successfully merging a pull request may close this issue.
Crash Report
Crash first introduced with the new plugin for
functools.partial
in #16939./CC @hauntsaninja
Traceback
To Reproduce
Your Environment
1.11.0+dev.10f18a82b612b6127659cd64aa60c10b9cc7a904
(current master)3.12
--
Changing the example slightly to add a second variable to
Data
results in new errors but the crash goes away.The text was updated successfully, but these errors were encountered: