-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
Description
Feature or enhancement
Currently, Argument Clinic will not allow parameters named module, even though they've got a custom C name. For example, this clinic input is rejected:
/*[clinic input] mod.func module as mod: object [clinic start generated code]*/AC complains with "You can't have two parameters named 'module'!", even though there is no naming collision on the C level. This issue prevents AC conversion of some functions and methods in the code base, for example warn_explicit() in Python/_warnings.c. A workaround is to provide a custom name to the self converter, however I view that as a hack; it adds unneeded clinic code.
Hack/workaround
/*[clinic input] mod.func _module: self(type="PyObject *") module as mod: object [clinic start generated code]*/Pitch
The fix is easy (its almost a one-liner), and it unlocks more AC conversions, without requiring unneeded hacks.
Patch
arhadthedev