Using a list as a default argument in Python will produce surprising results because it's mutable, so (w,li=[])
isn't what you want.
See here: "Least Astonishment" and the Mutable Default Argument
and here: http://www.deadlybloodyserious.com/2008/05/default-argument-blunders/
Short version is that default arguments are evaluated when the function is defined, not when the function is run like you'd expect.