Closed ziima closed 11 years ago
I think we should just make user_inputs=[]
the function default instead?
Never do that in python, for example http://stackoverflow.com/questions/1132941/least-astonishment-in-python-the-mutable-default-argument
That is true if we modify the input parameter, but we treat it immutably in zxcvbn. The following is completely fine in python and is (arguably) the right way to do things:
def f(a=[]):
print a
f()
f(a=[1])
f()
It is fine for now, but you never know, what changes you will do some day. Generally it is bad practice to use empty lists/dicts/any mutable as default arguments, even if you treat it immutably.