|
374 | 374 | ... case {**rest, "key": value}: |
375 | 375 | ... ... |
376 | 376 | Traceback (most recent call last): |
377 | | -SyntaxError: cannot use case statement with dict literal |
| 377 | +SyntaxError: cannot use dict literal as case pattern |
378 | 378 |
|
379 | 379 | >>> match ...: |
380 | 380 | ... case {**_}: |
381 | 381 | ... ... |
382 | 382 | Traceback (most recent call last): |
383 | | -SyntaxError: cannot use case statement with dict literal |
| 383 | +SyntaxError: cannot use dict literal as case pattern |
384 | 384 |
|
385 | 385 | >>> match ...: |
386 | 386 | ... case ...: ... |
387 | 387 | Traceback (most recent call last): |
388 | | -SyntaxError: cannot use case statement with ellipsis |
| 388 | +SyntaxError: cannot use ellipsis as case pattern |
389 | 389 |
|
390 | 390 | >>> match ...: |
391 | 391 | ... case 1 // 2: ... |
392 | 392 | Traceback (most recent call last): |
393 | | -SyntaxError: cannot use case statement with expression |
| 393 | +SyntaxError: cannot use expression as case pattern |
394 | 394 |
|
395 | 395 | >>> match ...: |
396 | 396 | ... case {1, 2, 3}: ... |
397 | 397 | Traceback (most recent call last): |
398 | | -SyntaxError: cannot use case statement with set display |
| 398 | +SyntaxError: cannot use set display as case pattern |
399 | 399 |
|
400 | 400 | >>> match ...: |
401 | 401 | ... case a[0]: ... |
402 | 402 | Traceback (most recent call last): |
403 | | -SyntaxError: cannot use case statement with subscript |
| 403 | +SyntaxError: cannot use subscript as case pattern |
404 | 404 |
|
405 | 405 | >>> match ...: |
406 | 406 | ... case a[0].method(): ... |
407 | 407 | Traceback (most recent call last): |
408 | | -SyntaxError: cannot use case statement with function call |
| 408 | +SyntaxError: cannot use function call as case pattern |
409 | 409 |
|
410 | 410 | # But prefixes of soft keywords should |
411 | 411 | # still raise specialized errors |
|
0 commit comments