@@ -96,7 +96,7 @@ def operator_arg_removal(
9696 yield node .with_changes (args = [* node .args [:i ], * node .args [i + 1 :]])
9797
9898
99- supported_str_methods_swap = [
99+ supported_symmetric_str_methods_swap = [
100100 ("lower" , "upper" ),
101101 ("upper" , "lower" ),
102102 ("lstrip" , "rstrip" ),
@@ -118,17 +118,17 @@ def operator_arg_removal(
118118 ("rsplit" , "split" )
119119]
120120
121- def operator_string_methods_swap (
121+ def operator_symmetric_string_methods_swap (
122122 node : cst .Call
123123 ) -> Iterable [cst .Call ]:
124124 """try to swap string method to opposite e.g. a.lower() -> a.upper()"""
125125
126- for old_call , new_call in supported_str_methods_swap :
126+ for old_call , new_call in supported_symmetric_str_methods_swap :
127127 if m .matches (node .func , m .Attribute (value = m .DoNotCare (), attr = m .Name (value = old_call ))):
128128 func_name = cst .ensure_type (node .func , cst .Attribute ).attr
129129 yield node .with_deep_changes (func_name , value = new_call )
130130
131- def unsymmetrical_string_methods_swap (
131+ def operator_unsymmetrical_string_methods_swap (
132132 node : cst .Call
133133) -> Iterable [cst .Call ]:
134134 """Try to handle specific mutations of string, which useful only in specific args combination."""
@@ -256,8 +256,8 @@ def operator_match(node: cst.Match) -> Iterable[cst.CSTNode]:
256256 (cst .UnaryOperation , operator_remove_unary_ops ),
257257 (cst .Call , operator_dict_arguments ),
258258 (cst .Call , operator_arg_removal ),
259- (cst .Call , operator_string_methods_swap ),
260- (cst .Call , unsymmetrical_string_methods_swap ),
259+ (cst .Call , operator_symmetric_string_methods_swap ),
260+ (cst .Call , operator_unsymmetrical_string_methods_swap ),
261261 (cst .Lambda , operator_lambda ),
262262 (cst .CSTNode , operator_keywords ),
263263 (cst .CSTNode , operator_swap_op ),
0 commit comments