FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make imprecise constraints handling more robust by ilevkivskyi · Pull Request #16502 · python/mypy · GitHub

Repository navigation

Make imprecise constraints handling more robust - #16502

Merged
JukkaL merged 1 commit into
python:masterfrom
ilevkivskyi:fix-imprecise-kinds
Nov 22, 2023
Merged

JukkaL merged 1 commit into
python:masterfrom
ilevkivskyi:fix-imprecise-kinds

Conversation

Copy link
Copy Markdown
Member

Fixes #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().

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

ilevkivskyi changed the title Make imprecise contraints handling more robust Make imprecise constraints handling more robust Nov 16, 2023

JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The new logic looks strictly better than the old one.

JukkaL merged commit 3e6b552 into python:master Nov 22, 2023
ilevkivskyi deleted the fix-imprecise-kinds branch November 22, 2023 15:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mypy 1.7.0, ParamSpec: Cannot infer type argument 1 of "function_name" when using keyword arguments.

2 participants


Back | FazBrowse Home | New Git URL