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
Update Tools/clinic/clinic.py
  • Loading branch information
erlend-aasland authored Feb 5, 2024
commit 52cc6b2e95a8a64e2499da23f26e6856a6471a90
7 changes: 4 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5292,10 +5292,11 @@ def state_modulename_name(self, line: str) -> None:
def add_function(self, func: Function) -> None:
# Insert a self converter automatically.
tp, name = correct_name_for_self(func)
kwargs: dict[str, Any] = {}
if func.cls and tp == "PyObject *":
kwargs['type'] = func.cls.typedef
func.self_converter = self_converter(name, name, func, **kwargs)
func.self_converter = self_converter(name, name, func,
type=func.cls.typedef)
else:
func.self_converter = self_converter(name, name, func)
func.parameters[name] = Parameter(
name,
inspect.Parameter.POSITIONAL_ONLY,
Expand Down
0