Empty list as default parameter
Fredrik Lundh
fredrik at pythonware.com
Sat Nov 22 19:59:51 EST 2003
Alex Panayotopoulos wrote:
> However, if I define a default as a new instance of an object...
>
> def process_tree2( myTree=tree() )
>
> ...then the function should, IMHO, create a new object every time it is
> entered. (By having func_defaults point to tree.__init__, or summat.)
point to tree.__init__ ?
you haven't spent much time thinking about this, have you?
</F>
More information about the Python-list
mailing list