Open kvdveer opened 2 days ago
Reproduces on current master (58825f7
), requires --check-untyped-defs
.
Bisected to a00fcba1e77ac944276b8c4ad0a31b7b05ded59f from #16942
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.
Good point! Using an inlined definition for functools.wraps
,
RuntimeError: Parameters cannot be constrained to
at constraints.py:410
AssertionError: Should not be able to get here.
at expandtype.py:118
AssertionError
at expandtype.py:246
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: