Skip to content

Commit 26a6b87

Browse files
committed
Simplify fastcall control & add comment
1 parent 1e1a4b2 commit 26a6b87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tools/clinic/libclinic/parse_args.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,13 @@ def __init__(self, func: Function, codegen: CodeGen) -> None:
267267
if self.func.critical_section:
268268
self.codegen.add_include('pycore_critical_section.h',
269269
'Py_BEGIN_CRITICAL_SECTION()')
270+
271+
# Use fastcall if not disabled, except if in a __new__ or
272+
# __init__ method, or if there is a **kwargs parameter.
270273
if self.func.disable_fastcall:
271274
self.fastcall = False
272275
elif self.var_keyword is not None:
273-
has_args = self.parameters or self.varpos
274-
self.fastcall = not has_args
276+
self.fastcall = False
275277
else:
276278
self.fastcall = not self.is_new_or_init()
277279

0 commit comments

Comments
 (0)