Skip to content

Commit

Permalink
fix: define type_params in gast.FunctionDef instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Feb 20, 2025
1 parent df6c75e commit 3fd88fd
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def visit_ClassDef(self, node):
decorator_list=method_node.decorator_list,
returns=method_node.returns,
type_comment=method_node.type_comment,
type_params=method_node.type_params if hasattr(method_node, "type_params") else [],
)
new_method_node = gast.copy_location(new_method_node, method_node)
BaseRenameTransformer(new_method_node).rename(
Expand Down Expand Up @@ -223,6 +224,7 @@ def remove_explicit_self_from_super_init(node):
decorator_list=method_node.decorator_list,
returns=method_node.returns,
type_comment=method_node.type_comment,
type_params=method_node.type_params if hasattr(method_node, "type_params") else [],
)
new_method_node = gast.copy_location(new_method_node, method_node)
self._method_nodes_to_add.append(new_method_node)
Expand Down

0 comments on commit 3fd88fd

Please sign in to comment.