mypy
mypy copied to clipboard
Fix another crash scenario on recursive tuple types
Fixes https://github.com/python/mypy/issues/17691
This looks quite ad-hoc, but the only clean alternative is to remove the existing recursive types optimization we have in subtypes.py. But the best I can get without that optimization is -7% performance penalty (on self-check). So I think it is not worth it, since it is still a corner case.
cc @JukkaL
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅