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

[do not review] Avoid narrowing TypeType by hauntsaninja · Pull Request #20636 · python/mypy · GitHub

Repository navigation

[do not review] Avoid narrowing TypeType - #20636

Closed
hauntsaninja wants to merge 1 commit into
python:masterfrom
hauntsaninja:narrow13
Closed

hauntsaninja wants to merge 1 commit into
python:masterfrom
hauntsaninja:narrow13

Conversation

Copy link
Copy Markdown
Collaborator

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

hauntsaninja mentioned this pull request Jan 22, 2026
hauntsaninja changed the title [wip] Avoid narrowing TypeType [do not review] Avoid narrowing TypeType Jan 22, 2026

Copy link
Copy Markdown
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL