strange behaviour with keyword arguments and inheritance
Alex Martelli
aleax at mac.com
Tue Apr 17 00:40:59 EDT 2007
Steve Holden <steve at holdenweb.com> wrote:
...
> > livibetter has a better solution. the reason is that you need to
> > create a new list object everytime, am I right?
> >
> Yes, specifically on every *call*.
...and livibetter's solution also creates a new list on every call to
Child (that [] passed on to Parent.__init__ does exactly that).
Alex
More information about the Python-list
mailing list