You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing an cache decorator that uses ParamSpec to be as generic as possible.
There's a slight bug in my code (I used Sequence where I should have used Paramspec.args), but I feel that shouldn't have led to a crash. There might actually be legitimate usecases for the incorrect code I wrote.
Traceback
mypy_bug_test.py:22: 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.2
Traceback (most recent call last):
File "mypy/checkexpr.py", line 5822, in accept
File "mypy/checkexpr.py", line 480, in visit_call_expr
File "mypy/checkexpr.py", line 614, in visit_call_expr_inner
File "mypy/checkexpr.py", line 1467, in check_call_expr_with_callee_type
File "mypy/checkexpr.py", line 1597, in check_call
File "mypy/checkexpr.py", line 1561, in check_call
File "mypy/checkexpr.py", line 1746, in check_callable_call
File "mypy/checkexpr.py", line 2062, in infer_function_type_arguments
File "mypy/checkexpr.py", line 2268, in get_arg_infer_passes
File "mypy/subtypes.py", line 1248, in find_member
File "mypy/subtypes.py", line 1383, in find_node_type
File "mypy/expandtype.py", line 114, in expand_type_by_instance
File "mypy/expandtype.py", line 69, in expand_type
File "mypy/types.py", line 2004, in accept
File "mypy/expandtype.py", line 408, in visit_callable_type
File "mypy/expandtype.py", line 500, in expand_types
File "mypy/types.py", line 769, in accept
File "mypy/expandtype.py", line 264, in visit_param_spec
AssertionError:
mypy_bug_test.py:22: : note: use --pdb to drop into pdb
To Reproduce
This is how far I've managed to whitle my testcase down:
The culprit found by the bisect just changed the definition of functools.wraps. It might be worth inlining the current definition of functools.wraps into the example and bisecting again to isolate the change in mypy itself that introduced the crash.
Crash Report
I'm developing an cache decorator that uses ParamSpec to be as generic as possible.
There's a slight bug in my code (I used
Sequence
where I should have usedParamspec.args
), but I feel that shouldn't have led to a crash. There might actually be legitimate usecases for the incorrect code I wrote.Traceback
To Reproduce
This is how far I've managed to whitle my testcase down:
Your Environment
Operating system: Debian Bookworm, python 3.11, virtualenv
mypy versions tested:
pyproject.toml:
The text was updated successfully, but these errors were encountered: