default argument value is mutable

Daiyue Weng daiyueweng at gmail.com
Fri Oct 7 07:38:03 EDT 2016


Hi, I declare two parameters for a function with default values [],

def one_function(arg, arg1=[], arg2=[]):

PyCharm warns me:

Default argument value is mutable,

what does it mean? and how to fix it?

cheers



More information about the Python-list mailing list