8000 gh-114258: Refactor Argument Clinic function name parser by erlend-aasland · Pull Request #114930 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-114258: Refactor Argument Clinic function name parser #114930

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 12 commits into from
Feb 15, 2024
Prev Previous commit
Next Next commit
Fixed most type errors
  • Loading branch information
erlend-aasland committed Feb 2, 2024
commit 8cbecadca072a5013aaf8aee49888a6af679980a
7 changes: 5 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5166,7 +5166,9 @@ def normalize_function_kind(self, fullname: str) -> None:
elif name == '__init__':
self.kind = METHOD_INIT

def resolve_return_converter(self, full_name: str, forced_converter):
def resolve_return_converter(
self, full_name: str, forced_converter: str
) -> CReturnConverter:
if forced_converter:
if self.kind in {GETTER, SETTER}:
fail(f"@{self.kind.name.lower()} method cannot define a return type")
Expand Down Expand Up @@ -5273,7 +5275,8 @@ def state_modulename_name(self, line: str) -> None:
self.function = Function(
name=function_name,
full_name=full_name,
module=module, cls=cls,
module=module,
cls=cls,
c_basename=c_basename,
return_converter=self.resolve_return_converter(full_name, returns),
kind=self.kind,
Expand Down
0