Suppose you have a Python class whose constructor looks something like this:
def __init__(self,fname=None,data=[],imobj=None,height=0,width=0):
and you want to create an instance of it but only provide the fname and imobj inputs. Would the correct way to do this be
thing = Thing(f_name, None, im_obj, None, None)
or is there a preferred way of making this call?
data=[]as a default argument, as iCodez writes below. What you want isdata=None, then in the body of the__init__you can writeif data is None: self.data = []or whatever you had planned to do with it.