You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument Clinic adds the "_value" suffix to the end of variable names in C if the parameter name is C keyword. But it left unmodified parameter names that can conflict with parameter names of C function: args and kwargs (and module and self if they are used not as the first parameter). Following declaration generates a code that can't bi compiled:
mod.func
args: object
kwargs: object
Either Argument Clinic should add the "_value" suffix to the end of these names, or use other names for parameters of generated parser function.
args is already mangled as __clinic_args. We should also mangle kwnames, since that is sometimes used instead of kwargs (for example, for METH_FASTCALL | METH_KEYWORDS).
Activity
serhiy-storchaka commentedon May 16, 2015
Argument Clinic adds the "_value" suffix to the end of variable names in C if the parameter name is C keyword. But it left unmodified parameter names that can conflict with parameter names of C function: args and kwargs (and module and self if they are used not as the first parameter). Following declaration generates a code that can't bi compiled:
mod.func
Either Argument Clinic should add the "_value" suffix to the end of these names, or use other names for parameters of generated parser function.
erlend-aasland commentedon May 1, 2023
argsis already mangled as__clinic_args. We should also manglekwnames, since that is sometimes used instead ofkwargs(for example, for METH_FASTCALL | METH_KEYWORDS).pythongh-68395: Avoid naming conflicts by mangling variable names in …
pythongh-68395: Avoid naming conflicts by mangling variable names in …
erlend-aasland commentedon May 5, 2023
FTR, AC complains if you try to use parameters named
self(for methods) ormodule(for functions), so we don't need to special case those two.Example failure if I try to add a param named "self" to
sqlite3.Connection.__init__:gh-68395: Avoid naming conflicts by mangling variable names in Argume…
Merge branch 'main' into inlinecomp2
pythongh-68395: Avoid naming conflicts by mangling variable names in …