A performance issue when using default value

alex23 wuwei23 at gmail.com
Mon Feb 1 00:58:06 EST 2010


keakon <kea... at gmail.com> wrote:
> The default value is mutable, and can be reused by all each call.
> So each call it will append 1 to the default value, that's very
> different than C++.

Being different from C++ is one of the many reasons some of us choose
Python ;)

This tends to bite most newcomers, so it's mentioned in the FAQ:
http://www.python.org/doc/faq/general/#id52



More information about the Python-list mailing list