pylint-errors

W0102 (dangerous-default-value)

:x: Problematic code:

def foo(data={}):
    data.update({'key': 'value'})
    return data

:heavy_check_mark: Correct code:

def foo(data):
    if not data:
        data = {'key': 'value'}
    return data

Rationale:

Used when a mutable value as list or dictionary is detected in a default value for an argument.