|
51 | 51 | "lambda x=0, /, y=1, *args, z, **kwargs: ..."), # posonlyargs |
52 | 52 | ("0x1234", "0x1234"), # Constant |
53 | 53 | ("1_000_000", "1_000_000"), # Constant |
| 54 | + ("Tuple[:,:]", "Tuple[:, :]"), # Index, Subscript, 2x Slice |
| 55 | + ("Tuple[1:2]", "Tuple[1:2]"), # Index, Subscript, Slice(no-step) |
| 56 | + ("Tuple[1:2:3]", "Tuple[1:2:3]"), # Index, Subscript, Slice |
| 57 | + ("x[:, np.newaxis, :, :]", |
| 58 | + "x[:, np.newaxis, :, :]"), # Index, Subscript, numpy extended syntax |
| 59 | + ("y[:, 1:3][np.array([0, 2, 4]), :]", |
| 60 | + "y[:, 1:3][np.array([0, 2, 4]), :]"), # Index, 2x Subscript, numpy extended syntax |
54 | 61 | ]) |
55 | 62 | def test_unparse(source, expected): |
56 | 63 | module = ast.parse(source) |
|
0 commit comments