Mutable Default Method Arguments In Python [duplicate]
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I am using the Python IDE PyCharm and something that is have by default is it will showing warning when I have a mutbale type as a default value. For example, when I have this: def status(self, options=[]): PyCharm wants it to looks like: def status(self, options=None): if not options: options = [] My question is whether or not this is a standard way