Skip to content

Commit b04b319

Browse files
luk3yxdflook
authored andcommitted
Remove annotations on positional-only arguments.
1 parent 5aaf5ca commit b04b319

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/python_minifier/transforms/remove_annotations.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def visit_FunctionDef(self, node):
2727
def visit_arguments(self, node):
2828
assert isinstance(node, ast.arguments)
2929

30+
if hasattr(node, 'posonlyargs') and node.posonlyargs:
31+
node.posonlyargs = [self.visit_arg(a) for a in node.posonlyargs]
32+
3033
if node.args:
3134
node.args = [self.visit_arg(a) for a in node.args]
3235

0 commit comments

Comments
 (0)