997 numPositionalArgs == 0 |
997 numPositionalArgs == 0 |
998 and not any(isinstance(a, ast.Starred) for a in node.args) |
998 and not any(isinstance(a, ast.Starred) for a in node.args) |
999 and not any(k.arg is None for k in node.keywords) |
999 and not any(k.arg is None for k in node.keywords) |
1000 and node.func.id == "dict" |
1000 and node.func.id == "dict" |
1001 ) or ( |
1001 ) or ( |
1002 numKeywordArgs == 0 and numKeywordArgs == 0 and node.func.id in ( |
1002 numPositionalArgs == 0 |
1003 "tuple", "list" |
1003 and numKeywordArgs == 0 |
1004 ) |
1004 and node.func.id in ("tuple", "list") |
1005 ): |
1005 ): |
1006 self.__error(node.lineno - 1, node.col_offset, "M188", node.func.id) |
1006 self.__error(node.lineno - 1, node.col_offset, "M188", node.func.id) |
1007 |
1007 |
1008 elif ( |
1008 elif ( |
1009 node.func.id in {"list", "reversed"} |
1009 node.func.id in {"list", "reversed"} |
1426 ## These methods are adapted from: flake8-implicit-str-concat v0.4.0 |
1426 ## These methods are adapted from: flake8-implicit-str-concat v0.4.0 |
1427 ## Original: Copyright (c) 2023 Dylan Turner |
1427 ## Original: Copyright (c) 2023 Dylan Turner |
1428 ####################################################################### |
1428 ####################################################################### |
1429 |
1429 |
1430 if sys.version_info < (3, 12): |
1430 if sys.version_info < (3, 12): |
|
1431 |
1431 def __isImplicitStringConcat(self, first, second): |
1432 def __isImplicitStringConcat(self, first, second): |
1432 """ |
1433 """ |
1433 Private method to check, if the given strings indicate an implicit string |
1434 Private method to check, if the given strings indicate an implicit string |
1434 concatenation. |
1435 concatenation. |
1435 |
1436 |