File: semanal-errors-python310.test

package info (click to toggle)
mypy 1.19.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,412 kB
  • sloc: python: 114,754; ansic: 13,343; cpp: 11,380; makefile: 257; sh: 28
file content (43 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[case testMatchUndefinedSubject]
import typing
match x:
    case _:
        pass
[out]
main:2: error: Name "x" is not defined

[case testMatchUndefinedValuePattern]
import typing
x = 1
match x:
    case a.b:
        pass
[out]
main:4: error: Name "a" is not defined

[case testMatchUndefinedClassPattern]
import typing
x = 1
match x:
    case A():
        pass
[out]
main:4: error: Name "A" is not defined

[case testNoneBindingWildcardPattern]
import typing
x = 1
match x:
    case _:
        _
[out]
main:5: error: Name "_" is not defined

[case testNoneBindingStarredWildcardPattern]
import typing
x = 1
match x:
    case [*_]:
        _
[out]
main:5: error: Name "_" is not defined