Browse Source
AC: Update unsupported_special_methods (GH-24956)
pull/25019/head
Dong-hee Na
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
Tools/clinic/clinic.py
|
|
|
@ -2159,7 +2159,6 @@ __matmul__ |
|
|
|
__mod__ |
|
|
|
__mul__ |
|
|
|
__neg__ |
|
|
|
__new__ |
|
|
|
__next__ |
|
|
|
__or__ |
|
|
|
__pos__ |
|
|
|
@ -4227,6 +4226,9 @@ class DSLParser: |
|
|
|
module, cls = self.clinic._module_and_class(fields) |
|
|
|
|
|
|
|
fields = full_name.split('.') |
|
|
|
if fields[-1] in 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!") |
|
|
|
@ -4237,8 +4239,6 @@ class DSLParser: |
|
|
|
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() |
|
|
|
|