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

gh-119972: typing: Fix specialization of generic with broken __eq__ #119973

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jun 3, 2024

@@ -5191,6 +5191,18 @@ class B(Generic[T]):
self.assertEqual(A[T], A[T])
self.assertNotEqual(A[T], B[T])

def test_buggy_eq(self):
class BrokenEq(abc.ABCMeta):
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't need to be ABCMeta to trigger this; just type is sufficient:

Suggested change
class BrokenEq(abc.ABCMeta):
class BrokenEq(type):

@JelleZijlstra
Copy link
Member Author

This breaks typing-extensions if backported to 3.12; probably not worth it. I'll probably push an alternative later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants