diff --git a/parso/python/errors.py b/parso/python/errors.py index 6fb7f67..db3a30f 100644 --- a/parso/python/errors.py +++ b/parso/python/errors.py @@ -742,6 +742,9 @@ class _AnnotatorRule(SyntaxRule): class _ArgumentRule(SyntaxRule): def is_issue(self, node): first = node.children[0] + if self._normalizer.version < (3, 8): + # a((b)=c) is valid in <3.8 + first = _remove_parens(first) if node.children[1] == '=' and first.type != 'name': if first.type == 'lambdef': # f(lambda: 1=1) diff --git a/test/test_python_errors.py b/test/test_python_errors.py index 26d9e6e..75ebb88 100644 --- a/test/test_python_errors.py +++ b/test/test_python_errors.py @@ -273,6 +273,9 @@ def test_too_many_levels_of_indentation(): assert not _get_error_list(build_nested('pass', 49, base=base)) assert _get_error_list(build_nested('pass', 50, base=base)) +def test_paren_kwarg(): + assert _get_error_list("print((sep)=seperator)", version="3.8") + assert not _get_error_list("print((sep)=seperator)", version="3.7") @pytest.mark.parametrize( 'code', [