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
{{ message }}
Repository navigation
Nondeterministic type-var error with LiteralString-bounded TypeVars #20528
Scenario 2: Without the comment (in different contexts)
Sometimes passes with no errors, sometimes shows:
example.py:28: error: Value of type variable "S" of "Response" cannot be "object" [type-var]
I'm not able to nail down exactly when each scenario surfaces but hopefully this is enough to go on as it otherwise presents as a regression since 1.19.0
Thanks for the issue! Yeah, #20345 is certainly related.
However, I can't actually reproduce any error on the snippet you provide. I ran several configurations of mypy 50 times each (master, 1.19.1, with and without --no-incremental).
Am I missing something? Are you able to make a playground that reproduces the issue on https://mypy-play.net ?
Activity
hauntsaninja commentedon Jan 5, 2026
Thanks for the issue! Yeah, #20345 is certainly related.
However, I can't actually reproduce any error on the snippet you provide. I ran several configurations of mypy 50 times each (master, 1.19.1, with and without --no-incremental).
Am I missing something? Are you able to make a playground that reproduces the issue on https://mypy-play.net ?
ericbuehl commentedon Jan 6, 2026
Hi @hauntsaninja I'm struggling to get a clean, isolated repro as this is in a non-trivial chunk of proprietary code. I'll keep trying though
What I can say from the outside is that this was the only new error finding by mypy when going from 0.19.0 to 0.19.1.
then, when adding
ignore[misc, type-var](there was already ignore[misc] here) I gethauntsaninja commentedon Jan 6, 2026
Thanks. If you can find a shareable repro, will be much much easier to find a fix