Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix attribute type resolution with multiple inheritance#18415

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@sterliakov
Copy link
Collaborator

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

Supersedes#18270 as requested by@ilevkivskyi.

This PR introduces two changes:

  • Add missingmap_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.

Lancetnik and headtr1ck reacted with thumbs up emoji
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@sterliakovsterliakov marked this pull request as ready for reviewJanuary 5, 2025 02:21
Copy link
Collaborator

@hauntsaninjahauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice, will leave for Ivan but had small comment

pass

class D(D0,D1,C):
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we expect an error for something like:

class D3(D0,D1,C):    class M(A.M):        pass

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We certainly should expect an error there as such an override violates LSP. But overrides are checked elsewhere, I'm only modifying inherited attributes compatibility checks in this PR.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@github-actions
Copy link
Contributor

Diff frommypy_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]

@ilevkivskyiilevkivskyi merged commitd86b1e5 intopython:masterJan 11, 2025
18 checks passed
ilevkivskyi pushed a commit that referenced this pull requestJan 11, 2025
…operty (#18441)Fixes#18189.Following#18415, this fixes one more place where parent class genericsaren't mapped to attributes correctly.---------Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja left review comments

@ilevkivskyiilevkivskyiilevkivskyi approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

3 participants

@sterliakov@ilevkivskyi@hauntsaninja

[8]ページ先頭

©2009-2025 Movatter.jp