mypy
3e6b5528 - Make imprecise constraints handling more robust (#16502)

Commit
2 years ago
Make imprecise constraints handling more robust (#16502) Fixes https://github.com/python/mypy/issues/16485 My initial implementation of imprecise constraints fallback was really fragile and ad-hoc, and I now see several edge case scenarios where we may end up using imprecise constraints for a `ParamSpec` while some precise ones are available. So I re-organized it: now we just infer everything as normally, and filter out imprecise (if needed) at the very end, when we have the full picture. I also fix an accidental omission in `expand_type()`.
Author
Parents
Loading