On Nov 15, Gregory Piñero wrote:
>    Hey guys, could anyone explain this behavior to me.  It doesn't
>    seem right :-(
>    def testfunc(parm1,parm2={}):
>        print 'parm2',parm2
>        parm2['key1']=5
>    >>testfunc('greg')
>    parm2 {}
>    >>testfunc('greg')
>    parm2 {'key1': 5}

http://www.python.org/doc/faq/general.html#why-are-default-values-shared-between-objects

-- 
_ _     ___
|V|icah |- lliott             <><             [EMAIL PROTECTED]
" "     """
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to