summaryrefslogtreecommitdiff
path: root/test/input/func_dangerous_default.py
blob: 8bf2c3fb852731eabcd7c7274c7ffe903be1a141 (plain)
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
"""docstring"""

__revision__ = ''

HEHE = {}

def function1(value=[]):
    """docstring"""
    print value

def function2(value=HEHE):
    """docstring"""
    print value

def function3(value):
    """docstring"""
    print value

def function4(value=set()):
    """set is mutable and dangerous."""
    print value

def function5(value=frozenset()):
    """frozenset is immutable and safe."""
    print value

GLOBAL_SET = set()

def function6(value=GLOBAL_SET):
    """set is mutable and dangerous."""
    print value

def function7(value=dict()):
    """dict is mutable and dangerous."""
    print value

def function8(value=list()):
    """list is mutable and dangerous."""
    print value

def function9(value=[1, 2, 3, 4]):
    """list with items should not output item values in error message"""
    print value

def function10(value={'a': 1, 'b': 2}):
    """dictionaries with items should not output item values in error message"""
    print value

def function11(value=list([1, 2, 3])):
    """list with items should not output item values in error message"""
    print value

def function12(value=dict([('a', 1), ('b', 2)])):
    """dictionaries with items should not output item values in error message"""
    print value

OINK = {
    'a': 1,
    'b': 2
}

def function13(value=OINK):
    """dictionaries with items should not output item values in error message"""
    print value