From fc0318207ac97cf226596cfb92d331ffea132dd7 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 16:58:55 +0100 Subject: [PATCH 01/16] Handle python 3.6 f-strings without error --- mypy/fastparse.py | 5 +++++ test-data/unit/check-expressions.test | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 97e916c4b028..656fd3469431 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -769,6 +769,11 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: else: return UnicodeExpr(n.s) + # JoinedStr(expr* values) + @with_line + def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: + return StrExpr(n.values[0]) + # Bytes(bytes s) @with_line def visit_Bytes(self, n: ast35.Bytes) -> Union[BytesExpr, StrExpr]: diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index ea234c1b6586..e17bcae15c53 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1157,6 +1157,15 @@ b'%c' % (123) [case testUnicodeInterpolation_python2] u'%s' % (u'abc',) + +-- F-String +-- -------- + + +[case testFStringParseOk] +a = f'foobar' + + -- Lambdas -- ------- From 31e025204f7ba1e71b171f844d39230f0c6b09be Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 18:40:33 +0100 Subject: [PATCH 02/16] Fix to support older versions of typed_ast --- mypy/fastparse.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 656fd3469431..9fccdf6f032f 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -769,10 +769,12 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: else: return UnicodeExpr(n.s) - # JoinedStr(expr* values) - @with_line - def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: - return StrExpr(n.values[0]) + # Only available with typed_ast >= 0.6.2 + if hasattr(ast35, 'JoinedStr'): + # JoinedStr(expr* values) + @with_line + def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: + return StrExpr(n.values[0]) # Bytes(bytes s) @with_line From 6c4aa78c4428bffc81daedbc7ce1fa1353b914ba Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 18:54:03 +0100 Subject: [PATCH 03/16] Fix f-string test --- test-data/unit/check-expressions.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index e17bcae15c53..5ba38b8cbfcc 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1163,7 +1163,8 @@ u'%s' % (u'abc',) [case testFStringParseOk] -a = f'foobar' +# flags: --fast-parser +f'foobar' -- Lambdas From 2112398454177e157b440c55351c973e7ba7077b Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 18:54:20 +0100 Subject: [PATCH 04/16] Add new f-string test to check expression type checking --- mypy/fastparse.py | 6 ++++++ test-data/unit/check-expressions.test | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 9fccdf6f032f..aeadef9996b6 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -776,6 +776,12 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: return StrExpr(n.values[0]) + # FormattedValue(expr value) + @with_line + def visit_FormattedValue(self, n: ast35.FormattedValue) -> StrExpr: + print(n, n.value, dir(n)) + return self.visit(n.value) + # Bytes(bytes s) @with_line def visit_Bytes(self, n: ast35.Bytes) -> Union[BytesExpr, StrExpr]: diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index 5ba38b8cbfcc..a9b58b44a5be 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1166,6 +1166,19 @@ u'%s' % (u'abc',) # flags: --fast-parser f'foobar' +[case testFStringTypecheckExpression] +# flags: --fast-parser +# flags: --python-version 3.6 +a: str +a = 'foo' +b: str +b = f'{a}bar' +b == 'foobar' +f'{1 + "a"}' +f'{1 + 1}' +[out] +main:2: error: Unsupported operand types for + ("int" and "str") + -- Lambdas -- ------- From 025c948d8fa8e99721cd731c4298ef6dbbe96343 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 19:15:47 +0100 Subject: [PATCH 05/16] Fix test flags --- mypy/fastparse.py | 1 - test-data/unit/check-expressions.test | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index aeadef9996b6..b1cf1e914a1a 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -779,7 +779,6 @@ def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: # FormattedValue(expr value) @with_line def visit_FormattedValue(self, n: ast35.FormattedValue) -> StrExpr: - print(n, n.value, dir(n)) return self.visit(n.value) # Bytes(bytes s) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index a9b58b44a5be..c5549aa32da2 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1167,8 +1167,7 @@ u'%s' % (u'abc',) f'foobar' [case testFStringTypecheckExpression] -# flags: --fast-parser -# flags: --python-version 3.6 +# flags: --fast-parser --python-version 3.6 a: str a = 'foo' b: str @@ -1177,7 +1176,7 @@ b == 'foobar' f'{1 + "a"}' f'{1 + 1}' [out] -main:2: error: Unsupported operand types for + ("int" and "str") +main:7: error: Unsupported operand types for + ("int" and "str") (diff) -- Lambdas From e8cb2821138c9e1c0c3492fdddaedc65bb09f36a Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 22:11:27 +0100 Subject: [PATCH 06/16] Split f-string tests and fix ast visit of JoinedStr --- mypy/fastparse.py | 7 +++++-- test-data/unit/check-expressions.test | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index b1cf1e914a1a..c223c23d665e 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -774,11 +774,14 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: # JoinedStr(expr* values) @with_line def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: - return StrExpr(n.values[0]) + result_string_expression = StrExpr('') + for value in n.values: + result_string_expression = OpExpr('+', result_string_expression, self.visit(value)) + return result_string_expression # FormattedValue(expr value) @with_line - def visit_FormattedValue(self, n: ast35.FormattedValue) -> StrExpr: + def visit_FormattedValue(self, n: ast35.FormattedValue) -> Expression: return self.visit(n.value) # Bytes(bytes s) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index c5549aa32da2..6746f595ad12 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1162,21 +1162,23 @@ u'%s' % (u'abc',) -- -------- -[case testFStringParseOk] -# flags: --fast-parser +[case testFStringBasics] +# flags: --fast-parser --python-version 3.6 f'foobar' +f'{"foobar"}' +f'foo{"bar"}' +a: str +a = f'foobar' +a = f'{"foobar"}' -[case testFStringTypecheckExpression] +[case testFStringExpressions] # flags: --fast-parser --python-version 3.6 -a: str -a = 'foo' -b: str -b = f'{a}bar' -b == 'foobar' -f'{1 + "a"}' -f'{1 + 1}' +f'{1 + ""}' +f' {1 + ""}' [out] -main:7: error: Unsupported operand types for + ("int" and "str") (diff) +main:2: error: Unsupported operand types for + ("int" and "str") +main:3: error: Unsupported operand types for + ("int" and "str") +main:3: error: Unsupported operand types for + ("str" and "int") -- Lambdas From d6ba5fd502fd3e93bf55471ef777abdde3baac23 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 30 Dec 2016 22:23:46 +0100 Subject: [PATCH 07/16] Use casts to fix typechecking of visitor method -> should we use a more complex solution by building an ast expression of `str(...)` to get rid of the casts? --- mypy/fastparse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index c223c23d665e..4026bfe60302 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -776,7 +776,8 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: result_string_expression = StrExpr('') for value in n.values: - result_string_expression = OpExpr('+', result_string_expression, self.visit(value)) + value_as_string_expr = cast(StrExpr, self.visit(value)) + result_string_expression = cast(StrExpr, OpExpr('+', result_string_expression, value_as_string_expr)) return result_string_expression # FormattedValue(expr value) From 25043d4e51205247dfcb5b0baddc627692e6e9fe Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Sat, 31 Dec 2016 20:49:04 +0100 Subject: [PATCH 08/16] Remove casts and fix return type of visit_JoinedStr --- mypy/fastparse.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 4026bfe60302..fa4800d505cb 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -773,12 +773,11 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: if hasattr(ast35, 'JoinedStr'): # JoinedStr(expr* values) @with_line - def visit_JoinedStr(self, n: ast35.JoinedStr) -> StrExpr: - result_string_expression = StrExpr('') - for value in n.values: - value_as_string_expr = cast(StrExpr, self.visit(value)) - result_string_expression = cast(StrExpr, OpExpr('+', result_string_expression, value_as_string_expr)) - return result_string_expression + def visit_JoinedStr(self, n: ast35.JoinedStr) -> Expression: + result_expression = StrExpr('') # type: Expression + for value_expr in self.translate_expr_list(n.values): + result_expression = OpExpr('+', result_expression, value_expr) + return result_expression # FormattedValue(expr value) @with_line From 8f17a4c88c73d066c8ec6de2ecffbeb6f8699f49 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Sun, 1 Jan 2017 17:47:41 +0100 Subject: [PATCH 09/16] Add new f-string test case --- test-data/unit/check-expressions.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index 6746f595ad12..c9e014a629fc 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1167,6 +1167,7 @@ u'%s' % (u'abc',) f'foobar' f'{"foobar"}' f'foo{"bar"}' +f'.{1}.' a: str a = f'foobar' a = f'{"foobar"}' @@ -1178,7 +1179,6 @@ f' {1 + ""}' [out] main:2: error: Unsupported operand types for + ("int" and "str") main:3: error: Unsupported operand types for + ("int" and "str") -main:3: error: Unsupported operand types for + ("str" and "int") -- Lambdas From 4847e27ac383d3fbaca782ee9f5e5842adaa236a Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Sun, 1 Jan 2017 17:47:59 +0100 Subject: [PATCH 10/16] Add call to __str__() before concatenating strings in visit_JoinedStr --- mypy/fastparse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index fa4800d505cb..e1aae287321e 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -776,7 +776,8 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: def visit_JoinedStr(self, n: ast35.JoinedStr) -> Expression: result_expression = StrExpr('') # type: Expression for value_expr in self.translate_expr_list(n.values): - result_expression = OpExpr('+', result_expression, value_expr) + stringified_value_expr = CallExpr(MemberExpr(value_expr, '__str__'), [], []) + result_expression = OpExpr('+', result_expression, stringified_value_expr) return result_expression # FormattedValue(expr value) From 5534c1a7427d03a26068d46574d5c4b0fb6826cf Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Mon, 2 Jan 2017 10:56:58 +0100 Subject: [PATCH 11/16] Fix tests by adding missing primitives --- test-data/unit/check-expressions.test | 2 ++ test-data/unit/fixtures/primitives.pyi | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index c9e014a629fc..27b8da5c625b 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1171,11 +1171,13 @@ f'.{1}.' a: str a = f'foobar' a = f'{"foobar"}' +[builtins fixtures/primitives.pyi] [case testFStringExpressions] # flags: --fast-parser --python-version 3.6 f'{1 + ""}' f' {1 + ""}' +[builtins fixtures/primitives.pyi] [out] main:2: error: Unsupported operand types for + ("int" and "str") main:3: error: Unsupported operand types for + ("int" and "str") diff --git a/test-data/unit/fixtures/primitives.pyi b/test-data/unit/fixtures/primitives.pyi index b6ec4d4a62d7..cb43d926e553 100644 --- a/test-data/unit/fixtures/primitives.pyi +++ b/test-data/unit/fixtures/primitives.pyi @@ -2,15 +2,18 @@ class object: def __init__(self) -> None: pass + def __str__(self) -> str: pass class type: def __init__(self, x) -> None: pass -class int: pass +class int: + def __add__(self, i: int) -> int: pass class float: pass class complex: pass class bool: pass -class str: pass +class str: + def __add__(self, s: str) -> str: pass class bytes: pass class bytearray: pass class tuple: pass From 5567215826441fcb7be0bbc4a00cf6d230940f22 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Mon, 2 Jan 2017 10:57:23 +0100 Subject: [PATCH 12/16] Add missing line numbers in newly constructed nodes --- mypy/fastparse.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index e1aae287321e..ee3518660506 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -776,8 +776,12 @@ def visit_Str(self, n: ast35.Str) -> Union[UnicodeExpr, StrExpr]: def visit_JoinedStr(self, n: ast35.JoinedStr) -> Expression: result_expression = StrExpr('') # type: Expression for value_expr in self.translate_expr_list(n.values): - stringified_value_expr = CallExpr(MemberExpr(value_expr, '__str__'), [], []) + string_method = MemberExpr(value_expr, '__str__') + string_method.set_line(value_expr) + stringified_value_expr = CallExpr(string_method, [], []) + stringified_value_expr.set_line(value_expr) result_expression = OpExpr('+', result_expression, stringified_value_expr) + result_expression.set_line(value_expr) return result_expression # FormattedValue(expr value) From 929c5efce934981315ddb93d46d03ff36d3bf996 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Tue, 3 Jan 2017 09:05:28 +0100 Subject: [PATCH 13/16] Add more tests on f-strings - expressions successfuly type checked - format options parsed --- test-data/unit/check-expressions.test | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index 27b8da5c625b..60b0fb6c3797 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1173,15 +1173,29 @@ a = f'foobar' a = f'{"foobar"}' [builtins fixtures/primitives.pyi] -[case testFStringExpressions] +[case testFStringExpressionsOk] +# flags: --fast-parser --python-version 3.6 +f'.{1 + 1}.' +f'.{1 + 1}.{"foo" + "bar"}' +[builtins fixtures/primitives.pyi] + +[case testFStringExpressionsErrors] # flags: --fast-parser --python-version 3.6 f'{1 + ""}' -f' {1 + ""}' +f'.{1 + ""}' [builtins fixtures/primitives.pyi] [out] main:2: error: Unsupported operand types for + ("int" and "str") main:3: error: Unsupported operand types for + ("int" and "str") +[case testFStringParseFormatOptions] +# flags: --fast-parser --python-version 3.6 +value = 10.5142 +width = 10 +precision = 4 +f'result: {value:{width}.{precision}}' +[builtins fixtures/primitives.pyi] + -- Lambdas -- ------- From 47d592ae37db114842b71818e542b3a1bfa16af4 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Wed, 15 Feb 2017 09:35:56 +0100 Subject: [PATCH 14/16] fix: Rename asst35 to ast3 --- mypy/fastparse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index acfa1d8302a4..1c7aa79279c4 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -851,10 +851,10 @@ def visit_Str(self, n: ast3.Str) -> Union[UnicodeExpr, StrExpr]: return UnicodeExpr(n.s) # Only available with typed_ast >= 0.6.2 - if hasattr(ast35, 'JoinedStr'): + if hasattr(ast3, 'JoinedStr'): # JoinedStr(expr* values) @with_line - def visit_JoinedStr(self, n: ast35.JoinedStr) -> Expression: + def visit_JoinedStr(self, n: ast3.JoinedStr) -> Expression: result_expression = StrExpr('') # type: Expression for value_expr in self.translate_expr_list(n.values): string_method = MemberExpr(value_expr, '__str__') @@ -867,7 +867,7 @@ def visit_JoinedStr(self, n: ast35.JoinedStr) -> Expression: # FormattedValue(expr value) @with_line - def visit_FormattedValue(self, n: ast35.FormattedValue) -> Expression: + def visit_FormattedValue(self, n: ast3.FormattedValue) -> Expression: return self.visit(n.value) # Bytes(bytes s) From 086702671509f73421586a43f281ae1c308750a8 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Wed, 15 Feb 2017 09:52:46 +0100 Subject: [PATCH 15/16] fix: Move f-string tests to check-newsyntax.test (executed only for >=3.6) --- test-data/unit/check-expressions.test | 39 --------------------------- test-data/unit/check-newsyntax.test | 39 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index 6ff5bbbcab93..77d38d3a56d4 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1158,45 +1158,6 @@ b'%c' % (123) u'%s' % (u'abc',) --- F-String --- -------- - - -[case testFStringBasics] -# flags: --fast-parser --python-version 3.6 -f'foobar' -f'{"foobar"}' -f'foo{"bar"}' -f'.{1}.' -a: str -a = f'foobar' -a = f'{"foobar"}' -[builtins fixtures/primitives.pyi] - -[case testFStringExpressionsOk] -# flags: --fast-parser --python-version 3.6 -f'.{1 + 1}.' -f'.{1 + 1}.{"foo" + "bar"}' -[builtins fixtures/primitives.pyi] - -[case testFStringExpressionsErrors] -# flags: --fast-parser --python-version 3.6 -f'{1 + ""}' -f'.{1 + ""}' -[builtins fixtures/primitives.pyi] -[out] -main:2: error: Unsupported operand types for + ("int" and "str") -main:3: error: Unsupported operand types for + ("int" and "str") - -[case testFStringParseFormatOptions] -# flags: --fast-parser --python-version 3.6 -value = 10.5142 -width = 10 -precision = 4 -f'result: {value:{width}.{precision}}' -[builtins fixtures/primitives.pyi] - - -- Lambdas -- ------- diff --git a/test-data/unit/check-newsyntax.test b/test-data/unit/check-newsyntax.test index da86ac5157f9..389203951fcb 100644 --- a/test-data/unit/check-newsyntax.test +++ b/test-data/unit/check-newsyntax.test @@ -107,3 +107,42 @@ f'' # E: Format strings are only supported in Python 3.6 and greater # flags: --fast-parser --python-version 3.5 async def f(): results = [i async for i in aiter() if i % 2] # E: Async comprehensions are only supported in Python 3.6 and greater + + +-- F-String +-- -------- + + +[case testNewSyntaxFStringBasics] +# flags: --fast-parser --python-version 3.6 +f'foobar' +f'{"foobar"}' +f'foo{"bar"}' +f'.{1}.' +a: str +a = f'foobar' +a = f'{"foobar"}' +[builtins fixtures/primitives.pyi] + +[case testNewSyntaxFStringExpressionsOk] +# flags: --fast-parser --python-version 3.6 +f'.{1 + 1}.' +f'.{1 + 1}.{"foo" + "bar"}' +[builtins fixtures/primitives.pyi] + +[case testNewSyntaxFStringExpressionsErrors] +# flags: --fast-parser --python-version 3.6 +f'{1 + ""}' +f'.{1 + ""}' +[builtins fixtures/primitives.pyi] +[out] +main:2: error: Unsupported operand types for + ("int" and "str") +main:3: error: Unsupported operand types for + ("int" and "str") + +[case testNewSyntaxFStringParseFormatOptions] +# flags: --fast-parser --python-version 3.6 +value = 10.5142 +width = 10 +precision = 4 +f'result: {value:{width}.{precision}}' +[builtins fixtures/primitives.pyi] From 8a17249f518c1432437ecf36c791136299d71601 Mon Sep 17 00:00:00 2001 From: Adrien Chauve Date: Fri, 17 Feb 2017 13:51:11 +0100 Subject: [PATCH 16/16] Minor cleanings --- test-data/unit/check-expressions.test | 1 - test-data/unit/check-newsyntax.test | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test index 77d38d3a56d4..8d221748023e 100644 --- a/test-data/unit/check-expressions.test +++ b/test-data/unit/check-expressions.test @@ -1157,7 +1157,6 @@ b'%c' % (123) [case testUnicodeInterpolation_python2] u'%s' % (u'abc',) - -- Lambdas -- ------- diff --git a/test-data/unit/check-newsyntax.test b/test-data/unit/check-newsyntax.test index 389203951fcb..331ad776c1c8 100644 --- a/test-data/unit/check-newsyntax.test +++ b/test-data/unit/check-newsyntax.test @@ -99,19 +99,15 @@ main:4: error: Unsupported target for indexed assignment main:5: error: Type cannot be declared in assignment to non-self attribute main:5: error: "str" has no attribute "x" -[case testNewSyntaxFstringError] -# flags: --fast-parser --python-version 3.5 -f'' # E: Format strings are only supported in Python 3.6 and greater - [case testNewSyntaxAsyncComprehensionError] # flags: --fast-parser --python-version 3.5 async def f(): results = [i async for i in aiter() if i % 2] # E: Async comprehensions are only supported in Python 3.6 and greater --- F-String --- -------- - +[case testNewSyntaxFstringError] +# flags: --fast-parser --python-version 3.5 +f'' # E: Format strings are only supported in Python 3.6 and greater [case testNewSyntaxFStringBasics] # flags: --fast-parser --python-version 3.6