From 3269d0751190a52b6be94b197e34bb66e7c4d80f Mon Sep 17 00:00:00 2001 From: Shaygan Hooshyari Date: Tue, 3 Sep 2024 11:29:55 -0700 Subject: [PATCH 1/2] Fix type annotation with two string literals --- conformance/tests/annotations_forward_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index 24111176f..e71bd14c1 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -38,7 +38,7 @@ class ClassA: # The following should all generate errors because they are not legal type # expressions, despite being enclosed in quotes. def invalid_annotations( - p1: "eval(" ".join(map(chr, [105, 110, 116])))", # E + p1: "eval(' '.join(map(chr, [105, 110, 116])))", # E p2: "[int, str]", # E p3: "(int, str)", # E p4: "[int for i in range(1)]", # E From 6555cfd0763f525b5c6f40c761425902db589e8d Mon Sep 17 00:00:00 2001 From: Shaygan Hooshyari Date: Tue, 3 Sep 2024 12:10:22 -0700 Subject: [PATCH 2/2] Update conformance/tests/annotations_forward_refs.py Co-authored-by: Jelle Zijlstra --- conformance/tests/annotations_forward_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index e71bd14c1..18f111e0c 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -38,7 +38,7 @@ class ClassA: # The following should all generate errors because they are not legal type # expressions, despite being enclosed in quotes. def invalid_annotations( - p1: "eval(' '.join(map(chr, [105, 110, 116])))", # E + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E p2: "[int, str]", # E p3: "(int, str)", # E p4: "[int for i in range(1)]", # E