src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py

branch
eric7
changeset 10122
f9b87800ecf2
parent 10119
64147a7e6393
child 10163
bab2f909e60b
equal deleted inserted replaced
10121:cae522f5a272 10122:f9b87800ecf2
2423 """ 2423 """
2424 for subnode in node.body: 2424 for subnode in node.body:
2425 if not isinstance(subnode, ast.Expr): 2425 if not isinstance(subnode, ast.Expr):
2426 continue 2426 continue
2427 2427
2428 if ( 2428 if isinstance(
2429 isinstance( 2429 subnode.value,
2430 subnode.value, 2430 (ast.List, ast.Set, ast.Dict),
2431 (ast.List, ast.Set, ast.Dict), 2431 ) or (
2432 ) 2432 isinstance(subnode.value, ast.Constant)
2433 or ( 2433 and (
2434 isinstance(subnode.value, ast.Constant) 2434 isinstance(
2435 and ( 2435 subnode.value.value,
2436 isinstance( 2436 (int, float, complex, bytes, bool),
2437 subnode.value.value,
2438 (int, float, complex, bytes, bool),
2439 )
2440 or subnode.value.value is None
2441 ) 2437 )
2438 or subnode.value.value is None
2442 ) 2439 )
2443 ): 2440 ):
2444 self.violations.append((subnode, "M518")) 2441 self.violations.append((subnode, "M518"))
2445 2442
2446 def __checkForM519(self, node): 2443 def __checkForM519(self, node):

eric ide

mercurial