Skip to content

AC: Update unsupported_special_methods #24956

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

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,6 @@ def __repr__(self):
__mod__
__mul__
__neg__
__new__
__next__
__or__
__pos__
Expand Down Expand Up @@ -4227,6 +4226,9 @@ def state_modulename_name(self, line):
module, cls = self.clinic._module_and_class(fields)

fields = full_name.split('.')
if fields[-1] in unsupported_special_methods:
Copy link
Member Author

Choose a reason for hiding this comment

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

Dear reviewers,
This change is intended to early detect the consistency of unsupported_special_methods.

fail(f"{fields[-1]} is a special method and cannot be converted to Argument Clinic! (Yet.)")

if fields[-1] == '__new__':
if (self.kind != CLASS_METHOD) or (not cls):
fail("__new__ must be a class method!")
Expand All @@ -4237,8 +4239,6 @@ def state_modulename_name(self, line):
self.kind = METHOD_INIT
if not return_converter:
return_converter = init_return_converter()
elif fields[-1] in unsupported_special_methods:
fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic! (Yet.)")

if not return_converter:
return_converter = CReturnConverter()
Expand Down