[mod_python] Default funtion values - memory leak?

Amand Tihon amand.tihon at alrj.org
Thu Dec 22 23:47:26 EST 2005


Le Vendredi 23 Décembre 2005 05:36, Lars Eriksen a écrit :
> I have the following configuration:
>
> Apache/2.0.55 (Win32) mod_python/3.2.5b Python/2.4.2
>
> And I have a function similar to
>
> def foo(bar=[])
>
> During the first request, bar is [].
>
> When execution enters the function during the second request, however, and
> no value for bar is supplied, bar is *not* [] in the function body, but
> contains the previous value!
>
> Is that in any way expected behaviour?

This is standard python behaviour.

You can find more informations on this subjet on 
http://docs.python.org/tut/node6.html#SECTION006710000000000000000

-- 
Amand Tihon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051223/d6c01202/attachment.bin


More information about the Mod_python mailing list