Re: default mutable arguments

2007-02-08 Thread Bruno Desthuilliers
Gigs_ a écrit : > I read that this is not the same: > if arg is None: arg = [] > arg = arg or [] > > > def functionF(argString="abc", argList = None): > if argList is None: argList = [] # < this > ... > def functionF(argString="abc", argList=None): > argList = argList

Re: default mutable arguments

2007-02-08 Thread Leif K-Brooks
Gigs_ wrote: > I read that this is not the same: > def functionF(argString="abc", argList = None): > if argList is None: argList = [] # < this > ... > def functionF(argString="abc", argList=None): > argList = argList or [] # and this > ... > > Why