Mutable objects as default arguments of functions
Default values in Python are created exactly once, when the function is defined. If that object is changed, subsequent calls to the function will refer to the changed object, leading to confusion. We recommend that you set the default value to `None`, then check inside the function if the parameter is `None` before creating the desired mutable object.
# Noncompliant: default arguments have mutable objects.
def with_complex_default_value_noncompliant(self, index=1, mydict={},
                                            mylist=[]):
    mydict[index] = mylist[index]
    return mydict
# Compliant: default arguments are assigned to None or unmutable objects.
def with_unmutable_objects_compliant(mydict=None, number=1, str="hi",
                                     mytuple=(1, 2)):
    print(mydict, number, str, mytuple)