| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Sorry, something went wrong.
There was a problem hiding this comment.
Nice, thanks!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add missing call to store inferred types if an overload match is found early. All other code paths already do that.
Some background on the issue this fixes
I recently saw an interesting pattern in aiohttp to type values in an dict[str, Any] by subclassing dict.
With the exception that these overloads aren't technically compatible with the supertype, they do the job.
The issue exists for the __setitem__ case. Without this PR the following would create an issue. Here var would be inferred as dict[Never, Never], even though it should be dict[Any, Any] which is the case for non-subclassed dicts.