1154 self.__error(node.lineno - 1, node.col_offset, "Y181", |
1154 self.__error(node.lineno - 1, node.col_offset, "Y181", |
1155 unparse(newNode), unparse(node)) |
1155 unparse(newNode), unparse(node)) |
1156 |
1156 |
1157 def __check182(self, node): |
1157 def __check182(self, node): |
1158 """ |
1158 """ |
1159 Private method to check for calls of type 'super(Foo, self)' that could |
1159 Private method to check for calls of type 'super()' that could |
1160 be shortened to 'super()'. |
1160 be shortened to 'super()'. |
1161 |
1161 |
1162 @param node reference to the AST node to be checked |
1162 @param node reference to the AST node to be checked |
1163 @type ast.Call |
1163 @type ast.Call |
1164 """ |
1164 """ |
1165 # super(Foo, self) |
1165 # super() |
1166 if ( |
1166 if ( |
1167 self.__classDefinitionStack and |
1167 self.__classDefinitionStack and |
1168 isinstance(node.func, ast.Name) and |
1168 isinstance(node.func, ast.Name) and |
1169 node.func.id == "super" and |
1169 node.func.id == "super" and |
1170 len(node.args) == 2 and |
1170 len(node.args) == 2 and |