Re: list extension ?
- From: "bruno.desthuilliers@xxxxxxxxx" <bruno.desthuilliers@xxxxxxxxx>
- Date: Mon, 30 Jun 2008 13:53:32 -0700 (PDT)
On 30 juin, 21:05, Stef Mientki <stef.mien...@xxxxxxxxx> wrote:
thanks guys,
def __init__ ( self, value = [] ) :
Gotcha : default argument values are eval'd only once. Also, it would
make more sense IMHO to follow the parent's class initializer's
behaviour:
Ah hem.... Sorry, should have double-checked:
def __init__(self, *args)
list.__init__ ( self, value )
list.__init__(self, *args)
that's even better, except the call must be
list.__init__ ( self, args )
Indeed. Which makes my whole comment about "following parent's class
behaviour" totally off-tracks. Should have shut up here :(
.
- References:
- list extension ?
- From: Stef Mientki
- Re: list extension ?
- From: Bruno Desthuilliers
- Re: list extension ?
- From: Stef Mientki
- list extension ?
- Prev by Date: Re: Freeze problem with Regular Expression
- Next by Date: Re: How do web templates separate content and logic?
- Previous by thread: Re: list extension ?
- Next by thread: Re: UnboundLocalError problems
- Index(es):