Well, now you do. That default list is only initialized once, not on each call. Please avoid writing code like you'd avoid ebola.
Instead consider writing one of these:
# python 2.5+defx(a=None):returnaifaelse
# the old but at times reviled syntaxdefx(a=None):returnaor
# memory usage here is not idealdefx(a=):returna[:]
If you've never run into this problem, it's probably because you follow the Python convention of not destructively modifying input
without explicit warning. If you're really never done it and aren't simply unaware that you've done it, hooray for you kind sir or madam, hooray for you.
Thanks to Chris Goffinet for explaining this to me after I repeatedly stepped up and down in PDB
watching a supposedly empty list enter the function populated.