stubber.codemod.modify_list =========================== .. py:module:: stubber.codemod.modify_list Classes ------- .. autoapisummary:: stubber.codemod.modify_list.ListChangeSet stubber.codemod.modify_list.ModifyListElements Module Contents --------------- .. py:class:: 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 .. py:attribute:: add :type: Sequence[libcst.BaseExpression] :value: [] .. py:attribute:: remove :type: Sequence[libcst.matchers.BaseMatcherNode] :value: [] .. py:attribute:: replace :type: bool :value: False .. py:method:: from_strings(*, add: Optional[Sequence[str]] = None, remove: Optional[Sequence[str]] = None, replace: bool = False) -> ListChangeSet :classmethod: .. py:class:: ModifyListElements(*, change_set: ListChangeSet) Bases: :py:obj:`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. .. py:attribute:: change_set :type: ListChangeSet .. py:method:: modify_list_elements(original_node: libcst.List, updated_node: libcst.List) -> libcst.List