8000 gh-112205: Support @getter annotation from AC by corona10 · Pull Request #112396 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112205: Support @getter annotation from AC #112396

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 18 commits into from
Nov 30, 2023
Merged
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed Nov 28, 2023
commit dde933e3e4d73ceb7ea00a876303c8908ca795c5
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ class CLanguage(Language):
""")
GETTERDEF_PROTOTYPE_DEFINE: Final[str] = normalize_snippet(r"""
#define {methoddef_name} \
{{"{name}", {methoddef_cast}{c_basename}{methoddef_cast_end}, NULL, NULL}},
{{"{name}", (getter){c_basename}, NULL, NULL}},
""")
METHODDEF_PROTOTYPE_IFNDEF: Final[str] = normalize_snippet("""
#ifndef {methoddef_name}
Expand Down Expand Up @@ -1686,7 +1686,7 @@ def parser_body(
if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'):
methoddef_cast = "(PyCFunction)"
elif f.kind is GETTER:
methoddef_cast = "(getter)"
methoddef_cast = "" # This should end up unused
elif limited_capi:
methoddef_cast = "(PyCFunction)(void(*)(void))"
else:
Expand Down
0