stubber.codemod.modify_list
¶
Module Contents¶
Classes¶
Describes a set of changes to be made to a list. |
|
Modifies the elements of a list (i.e, of modules to stub or exclude), |
- class stubber.codemod.modify_list.ListChangeSet¶
Describes a set of changes to be made to a list. - add: a list of elements to add to the list - remove: a list of elements to remove from the list - replace: if True, the list will be replaced with the elements in add
- add: Sequence[libcst.BaseExpression]¶
- remove: Sequence[libcst.matchers.BaseMatcherNode]¶
- class stubber.codemod.modify_list.ModifyListElements(*, change_set: ListChangeSet)¶
Bases:
stubber.codemod.utils.ScopeableMatcherTransformer
Modifies the elements of a list (i.e, of modules to stub or exclude), adding and removing elements as specified in the change_set.
- Parameters:
change_set (ListChangeSet) –
- change_set: ListChangeSet¶
- modify_list_elements(original_node: libcst.List, updated_node: libcst.List) libcst.List ¶
- Parameters:
original_node (libcst.List) –
updated_node (libcst.List) –
- Return type:
libcst.List