mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-28 23:23:20 +08:00
PEP 8
This commit is contained in:
1 parent
dfe7fba08e
commit
a5686d6cda
2 files changed
+14
-3
No files matched your search
@@ -6,7 +6,6 @@ from contextlib import contextmanager
|
||||
|
||||
from parso.normalizer import Normalizer, NormalizerConfig, Issue, Rule
|
||||
from parso.python.tree import search_ancestor
|
||||
from parso.parser import ParserSyntaxError
|
||||
|
||||
_BLOCK_STMTS = ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', 'with_stmt')
|
||||
_STAR_EXPR_PARENTS = ('testlist_star_expr', 'testlist_comp', 'exprlist')
|
||||
@@ -107,6 +106,7 @@ def _iter_definition_exprs_from_lists(exprlist):
|
||||
|
||||
yield child
|
||||
|
||||
|
||||
def _get_expr_stmt_definition_exprs(expr_stmt):
|
||||
exprs = []
|
||||
for list_ in expr_stmt.children[:-2:2]:
|
||||
@@ -279,7 +279,6 @@ class ErrorFinder(Normalizer):
|
||||
return ''
|
||||
return super(ErrorFinder, self).visit(node)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def visit_node(self, node):
|
||||
self._check_type_rules(node)
|
||||
@@ -787,7 +786,8 @@ class _ArglistRule(SyntaxRule):
|
||||
if first == '*':
|
||||
if kw_unpacking_only:
|
||||
# foo(**kwargs, *args)
|
||||
message = "iterable argument unpacking follows keyword argument unpacking"
|
||||
message = "iterable argument unpacking " \
|
||||
"follows keyword argument unpacking"
|
||||
self.add_issue(argument, message=message)
|
||||
else:
|
||||
kw_unpacking_only = True
|
||||
@@ -809,6 +809,7 @@ class _ArglistRule(SyntaxRule):
|
||||
message = "positional argument follows keyword argument"
|
||||
self.add_issue(argument, message=message)
|
||||
|
||||
|
||||
@ErrorFinder.register_rule(type='parameters')
|
||||
@ErrorFinder.register_rule(type='lambdef')
|
||||
class _ParameterRule(SyntaxRule):
|
||||
|
||||
Reference in new issue
Block a user