|
140 | 140 | ["func = lambda m=2: 2 * m; [func(), func(3), func(m=4)]", [4, 6, 8]],
|
141 | 141 | ["thres = 1; list(filter(lambda x: x < thres, range(-5, 5)))", [-5, -4, -3, -2, -1, 0]],
|
142 | 142 | ["y = 5; y = y + (x := 2 * y); [x, y]", [10, 15]],
|
| 143 | + ["x: int = 10; x", 10], |
| 144 | + ["x: int = [10, 20]; x", [10, 20]], |
143 | 145 | ["Foo = type('Foo', (), {'x': 100}); Foo.x = 10; Foo.x", 10],
|
144 | 146 | ["Foo = type('Foo', (), {'x': 100}); Foo.x += 10; Foo.x", 110],
|
145 | 147 | ["Foo = [type('Foo', (), {'x': 100})]; Foo[0].x = 10; Foo[0].x", 10],
|
@@ -1429,6 +1431,7 @@ async def test_eval(hass):
|
1429 | 1431 | "Exception in test line 1 column 21: too few values to unpack (expected 3)",
|
1430 | 1432 | ],
|
1431 | 1433 | ["(x, y) = 1", "Exception in test line 1 column 9: cannot unpack non-iterable object"],
|
| 1434 | + ["x: int; x", "Exception in test line 1 column 8: name 'x' is not defined"], |
1432 | 1435 | [
|
1433 | 1436 | "a, *y, w, z = range(2)",
|
1434 | 1437 | "Exception in test line 1 column 20: too few values to unpack (expected at least 3)",
|
|
0 commit comments