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

Avoid spurious non-overlapping eq error with metaclass with__eq__#19220

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

Merged
JukkaL merged 1 commit intomasterfromelvis-eq
Jun 4, 2025

Conversation

@msullivan
Copy link
Collaborator

@msullivanmsullivan commentedJun 3, 2025
edited
Loading

Currently, doing an== on atype[Foo] whereFoo has a metaclass
that defines__eq__ will spuriously produce a non-overlapping equality
error, becausecustom_special_method, a helper used in the check,
does not consider theTypeType case.

Fix that.

Currently, doing an `==` on a `type[Foo]` where `Foo` has a metaclassthat defines `__eq__` will spurious produce a non-overlapping equalityerror, because `custom_special_method`, a helper used in the check,does not consider the `TypeType` case.Fix that.
@msullivanmsullivan requested review fromJukkaL andjhanceJune 3, 2025 20:05
@github-actions
Copy link
Contributor

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

antidote (https://github.com/Finistere/antidote): 1.32x slower (69.4s -> 91.5s in single noisy sample)janus (https://github.com/aio-libs/janus): 1.63x faster (10.8s -> 6.6s in single noisy sample)AutoSplit (https://github.com/Toufool/AutoSplit): 1.05x faster (111.7s -> 106.3s in single noisy sample)mypy (https://github.com/python/mypy): 1.06x slower (108.7s -> 115.2s in single noisy sample)discord.py (https://github.com/Rapptz/discord.py): 1.09x slower (266.6s -> 290.9s in single noisy sample)

Copy link
Member

@ilevkivskyiilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks!

(and it is great to have you back :-))

msullivan and hauntsaninja reacted with heart emoji
@JukkaLJukkaL merged commitf295bb8 intomasterJun 4, 2025
19 checks passed
@JukkaLJukkaL deleted the elvis-eq branchJune 4, 2025 15:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ilevkivskyiilevkivskyiilevkivskyi approved these changes

@JukkaLJukkaLAwaiting requested review from JukkaL

@jhancejhanceAwaiting requested review from jhance

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@msullivan@ilevkivskyi@JukkaL

[8]ページ先頭

©2009-2025 Movatter.jp