File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,14 +112,14 @@ class GoogleStyleGuideChecker(checkers.BaseChecker):
112112 'help' : 'Number of AST nodes permitted in a lambda' }),
113113 )
114114
115- unary_operators = {
115+ UNARY_OPERATORS = {
116116 "~" : "invert" ,
117117 "-" : "neg" ,
118118 "not" : "not_" ,
119119 "+" : "pos"
120120 }
121121
122- binary_operators = {
122+ BINARY_OPERATORS = {
123123 "+" : "add" ,
124124 "-" : "sub" ,
125125 "*" : "mul" ,
@@ -325,7 +325,7 @@ def __lambda_func(self, node): # type: (astroid.Lambda) -> None
325325 """Prefer Operator Function to Lambda Functions"""
326326
327327 if isinstance (node .body , astroid .UnaryOp ):
328- operator = self .unary_operators . get ( node .body .op )
328+ operator = self .UNARY_OPERATORS [ node .body .op ]
329329 argname = node .args .args [0 ].name
330330 if operator and not isinstance (node .body .operand , astroid .BinOp ) and argname is node .body .operand .name :
331331 varname = node .body .operand .name
@@ -335,7 +335,7 @@ def __lambda_func(self, node): # type: (astroid.Lambda) -> None
335335 elif isinstance (node .body , astroid .BinOp ):
336336 if shopify_python .ast .count_tree_size (node .body ) == 3 and len (node .args .args ) == 2 :
337337 node = node .body
338- operator = self .binary_operators . get ( node .op )
338+ operator = self .BINARY_OPERATORS [ node .op ]
339339 if operator :
340340 left = str (node .left .value ) if node .left .name == 'int' else node .left .name
341341 right = str (node .right .value ) if node .right .name == 'int' else node .right .name
You can’t perform that action at this time.
0 commit comments