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 @deprecated on classes with only __new__ #193

Merged
merged 1 commit into from May 25, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 25, 2023

Fixes #192

@@ -382,6 +384,8 @@ def __init__(self, x) -> None:
instance = HasNew(42)
self.assertEqual(instance.x, 42)
self.assertTrue(has_new_called)

def test_class_with_inherited_new(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This name is different from test_inherit_from_class_with_new in the CPython PR, but I guess it's also missing some of the tests in that PR

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll have to update the CPython PR with these changes if the PEP does get accepted.

@JelleZijlstra JelleZijlstra merged commit 2912585 into python:main May 25, 2023
16 checks passed
@JelleZijlstra JelleZijlstra deleted the fixdepr branch May 25, 2023 12:46
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.

deprecated raises spurious TypeError on classes which define only __new__
2 participants