-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixed a regression in overload matching that resulted in false positi… #6163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ve errors in hydra-zen. This change involves removing a heuristic from overload matching that attempted to eliminate a false positive error for `x: list[str] = "a,b".split(",")`. This addresses #6160.
Diff from mypy_primer, showing the effect of this PR on open source code: discord.py (https://github.com/Rapptz/discord.py)
- /tmp/mypy_primer/projects/discord.py/discord/audit_logs.py:394:47 - warning: Unnecessary "# type: ignore" comment
- /tmp/mypy_primer/projects/discord.py/discord/audit_logs.py:400:47 - warning: Unnecessary "# type: ignore" comment
- /tmp/mypy_primer/projects/discord.py/discord/ui/select.py:336:49 - warning: Unnecessary "# type: ignore" comment
- 48 errors, 14 warnings, 0 informations
+ 48 errors, 11 warnings, 0 informations
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_frame.py:1464:22 - error: Expression of type "DataFrame" cannot be assigned to declared type "Series[Unknown]"
+ "DataFrame" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_frame.py:1521:39 - error: Argument of type "Timestamp" cannot be assigned to parameter "__iterable" of type "Iterable[_T@list]" in function "__init__"
+ "Timestamp" is incompatible with protocol "Iterable[_T@list]"
+ "__iter__" is not present (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:35:21 - error: Expression of type "Timestamp" cannot be assigned to declared type "Series[Unknown]"
+ "Timestamp" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:37:21 - error: Expression of type "Timestamp" cannot be assigned to declared type "Series[Unknown]"
+ "Timestamp" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:38:21 - error: Expression of type "Timestamp" cannot be assigned to declared type "Series[Unknown]"
+ "Timestamp" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:41:28 - error: Expression of type "Timestamp" cannot be assigned to declared type "DatetimeIndex"
+ "Timestamp" is incompatible with "DatetimeIndex" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:44:28 - error: Expression of type "Timestamp" cannot be assigned to declared type "DatetimeIndex"
+ "Timestamp" is incompatible with "DatetimeIndex" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:45:28 - error: Expression of type "Timestamp" cannot be assigned to declared type "DatetimeIndex"
+ "Timestamp" is incompatible with "DatetimeIndex" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:46:28 - error: Expression of type "Timestamp" cannot be assigned to declared type "DatetimeIndex"
+ "Timestamp" is incompatible with "DatetimeIndex" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_pandas.py:47:21 - error: Expression of type "Timestamp" cannot be assigned to declared type "Series[Unknown]"
+ "Timestamp" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_series.py:87:28 - error: Expression of type "Timestamp" cannot be assigned to declared type "DatetimeIndex"
+ "Timestamp" is incompatible with "DatetimeIndex" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_series.py:1237:25 - error: Expression of type "TimestampSeries" cannot be assigned to declared type "Series[str]"
+ "TimestampSeries" is incompatible with "Series[str]"
+ Type parameter "S1@Series" is invariant, but "Timestamp" is not the same as "str" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pandas-stubs/tests/test_timefuncs.py:74:26 - error: Expression of type "Timedelta" cannot be assigned to declared type "Timestamp"
+ "Timedelta" is incompatible with "Timestamp" (reportGeneralTypeIssues)
- 1428 errors, 0 warnings, 0 informations
+ 1441 errors, 0 warnings, 0 informations
|
@Dr-Irv, FYI, this bug fix may have an impact on |
@erictraut is this released yet so we can test? |
This change was included in pyright 1.1.332, which was released last week Tuesday. It was also in last week's prerelease version of Pylance. It will be in this week's production Pylance release (normally published every Wed). |
OK, it looks like this is just noise, because in pandas-dev/pandas-stubs#802 our CI tests are passing with 1.1.332 |
…ve errors in hydra-zen. This change involves removing a heuristic from overload matching that attempted to eliminate a false positive error for
x: list[str] = "a,b".split(",")
. This addresses #6160.