Skip to content
Prev Previous commit
Next Next commit
Simplify fastcall control & add comment
  • Loading branch information
AA-Turner committed Sep 18, 2025
commit 26a6b87892a088ce218926c7098a99c7db3c4e41
6 changes: 4 additions & 2 deletions Tools/clinic/libclinic/parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ def __init__(self, func: Function, codegen: CodeGen) -> None:
if self.func.critical_section:
self.codegen.add_include('pycore_critical_section.h',
'Py_BEGIN_CRITICAL_SECTION()')

# Use fastcall if not disabled, except if in a __new__ or
# __init__ method, or if there is a **kwargs parameter.
if self.func.disable_fastcall:
self.fastcall = False
elif self.var_keyword is not None:
has_args = self.parameters or self.varpos
self.fastcall = not has_args
self.fastcall = False
else:
self.fastcall = not self.is_new_or_init()

Expand Down