File: err_126.py

package info (click to toggle)
python-refurb 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,700 kB
  • sloc: python: 9,468; makefile: 40; sh: 6
file content (106 lines) | stat: -rw-r--r-- 1,359 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# these will match

def is_even(x):
    if x % 2 == 0:
        return True

    else:
        return False


def is_even_again(x):
    match x % 2:
        case 0:
            return True

        case _:
            return False

def nested(x):
    match x % 2:
        case 0:
            return True

        case _:
            match x % 3:
                case 0:
                    return True

                case _:
                    return False

def match_multiple_stmts(x):
    match x:
        case 1:
            pass

            return 1

        case 2:
            pass

            return 2

        case _:
            return 3


# these will not

def func(x):
    if x == 1:
        return True

    else:
        pass

        return False

def func2(x):
    match x % 2:
        case 0:
            return True

        case _:
            pass

            return False

def func3(x):
    match x % 2:
        case 0:
            return True

    return False

def func4(x):
    if x == 1:
        return True

    return False

def func5():
    return False

def func6(x):
    match x:
        case 1:
            return 1

        case 2:
            return 2

def func7(x):
    match x:
        case 1:
            pass

        case _:
            return 2

def func8(x):
    if x == 1:
        pass

    else:
        return 1