Skip to content
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

Fix attribute type resolution with multiple inheritance #18415

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sterliakov
Copy link
Contributor

Fixes #18268. Fixes #9319. Fixes #14279. Fixes #9031.

Supersedes #18270 as requested by @ilevkivskyi.

This PR introduces two changes:

  • Add missing map_type_from_supertype when checking generic attributes
  • Only compare the first base defining a name to all following in MRO - others are not necessarily pairwise compatible.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Jan 4, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

xarray (https://github.com/pydata/xarray)
+ xarray/core/groupby.py:1610: error: Unused "type: ignore" comment  [unused-ignore]
+ xarray/core/groupby.py:1778: error: Unused "type: ignore" comment  [unused-ignore]
+ xarray/core/resample.py:236: error: Unused "type: ignore" comment  [unused-ignore]
+ xarray/core/resample.py:379: error: Unused "type: ignore" comment  [unused-ignore]

ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:280: error: Definition of "get" in base class "Mapping" is incompatible with definition in base class "Mapping"  [misc]

@sterliakov sterliakov marked this pull request as ready for review January 5, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant