Skip to content

Commit

Permalink
find_kwargs: Also generically visit, to ensure function bodies get wa…
Browse files Browse the repository at this point in the history
…lked properly
  • Loading branch information
Rosuav committed Jan 17, 2024
1 parent 883163d commit 93f3462
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions find_kwargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def visit_Call(self, node):
stats["KwCount"] += len(node.keywords)
stats["MaxMatch"] = max(stats["MaxMatch"], matches)
stats["MaxKwargs"] = max(stats["MaxKwargs"], len(node.keywords))
self.generic_visit(node)
def visit_FunctionDef(self, node):
stats["FunctionDefs"] += 1
a = node.args
Expand All @@ -38,6 +39,7 @@ def visit_FunctionDef(self, node):
stats["ParamsKwPos"] += len(a.args)
stats["ParamsKwOnly"] += len(a.kwonlyargs)
stats["ParamsPosOnly"] += len(a.posonlyargs)
self.generic_visit(node)

for root, dirs, files in os.walk("."):
for fn in files:
Expand Down

0 comments on commit 93f3462

Please sign in to comment.