[do not review] Avoid narrowing TypeType#20636
Closed
hauntsaninja wants to merge 1 commit intopython:masterfrom
Closed
[do not review] Avoid narrowing TypeType#20636hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja wants to merge 1 commit intopython:masterfrom
Conversation
This relates to changes made in python#20492
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: spark (https://github.com/apache/spark)
- python/pyspark/mllib/regression.py:282: error: Unused "type: ignore" comment [unused-ignore]
- python/pyspark/mllib/regression.py:282: error: Incompatible return value type (got "LogisticRegressionModel", expected "LM") [return-value]
- python/pyspark/mllib/regression.py:282: note: Error code "return-value" not covered by "type: ignore" comment
zulip (https://github.com/zulip/zulip)
- analytics/views/stats.py:577: error: Incompatible return value type (got "QuerySet[RealmCount, RealmCount]", expected "QuerySet[CountT, CountT]") [return-value]
- analytics/views/stats.py:579: error: Incompatible return value type (got "QuerySet[UserCount, UserCount]", expected "QuerySet[CountT, CountT]") [return-value]
- analytics/views/stats.py:581: error: Incompatible return value type (got "QuerySet[StreamCount, StreamCount]", expected "QuerySet[CountT, CountT]") [return-value]
- analytics/views/stats.py:583: error: Incompatible return value type (got "QuerySet[InstallationCount, InstallationCount]", expected "QuerySet[CountT, CountT]") [return-value]
- analytics/views/stats.py:585: error: Incompatible return value type (got "QuerySet[RemoteInstallationCount, RemoteInstallationCount]", expected "QuerySet[CountT, CountT]") [return-value]
- analytics/views/stats.py:587: error: Incompatible return value type (got "QuerySet[RemoteRealmCount, RemoteRealmCount]", expected "QuerySet[CountT, CountT]") [return-value]
pandera (https://github.com/pandera-dev/pandera)
+ tests/pandas/test_schema_components.py:590: error: "Iterable[Any]" has no attribute "tolist" [attr-defined]
xarray (https://github.com/pydata/xarray)
+ xarray/indexes/nd_point_index.py: note: In member "from_variables" of class "NDPointIndex":
+ xarray/indexes/nd_point_index.py:271: error: Incompatible types in assignment (expression has type "type[ScipyKDTreeAdapter]", variable has type "type[T_TreeAdapter]") [assignment]
artigraph (https://github.com/artigraph/artigraph)
+ src/arti/views/__init__.py:98: error: Incompatible types in assignment (expression has type "type[View] | None", variable has type "type[Self]") [assignment]
+ src/arti/views/__init__.py:102: error: Incompatible types in assignment (expression has type "type[View] | None", variable has type "type[Self]") [assignment]
|
pull bot
pushed a commit
to Spencerx/mypy
that referenced
this pull request
Jan 28, 2026
Maybe a little ad hoc, but avoids some of the undesirable primer regression from python#20492 Closes python#20636
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to changes made in #20492
It undoes some of the new narrowing, which has both good and bad effects, i.e. if we merge this, we'll need to re-open some issues
Opening this mainly as a way to keep an eye on primer as I try out a few things in this space