where dos the default agument live in? local name spaces or gloabal namespaces or else?

lion dance_code at hotmail.com
Fri Aug 16 05:17:53 CEST 2002


I just feel name spaces are ambiguous in a sense.If I defined a
function in the Python shell:
>>>def f(a, L=[]):
       L.append(a)
       return L
and I invoked it with the default agrument value: f(1).Now I don't
know where the default agument L lives in? No matter I use dir() or
dir(f),there is no L listed in the result.



More information about the Python-list mailing list