On Wed, Apr 2, 2008 at 3:59 PM,  <[EMAIL PROTECTED]> wrote:
> I ran into a similar situation like the following (ipython session).
>  Can anyone please explain why the behavior?

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

Since you got bitten by this, you may also find it useful to take a
look at one of the pages that talks about common python problems, like
http://zephyrfalcon.org/labs/python_pitfalls.html or
http://www.ferg.org/projects/python_gotchas.html (both of which
mention the problems with mutable default arguments).

-- 
Jerry
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to