On Sun, 30 Mar 2008 21:34:00 -0700
John Nagle <[EMAIL PROTECTED]> wrote:
> What's actually happening to you is that you've run into one of the
> dumber features of Python - default values for parameters which are
> mutable, like lists, result in rather unexpected behavior. The
> problem is that
>
> def __init__(self, pcap = None, sids = []):
I have never liked using that form for different reasons so I never
tripped over that. Now I have another reason to avoid it. It's not a
huge deal to do this.
def __init__(self, pcap = None, sids = None):
if sids is None: sids = []
--
D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
--
http://mail.python.org/mailman/listinfo/python-list