fhdl: fix list references (thanks Lars)
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 11 Dec 2011 19:17:29 +0000 (20:17 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 11 Dec 2011 19:17:29 +0000 (20:17 +0100)
migen/fhdl/structure.py

index f531ff3e73264ef1358c5dfabeebd82371f90270..b5a87f2cfedd4516082e760ec3c3ee09712bb792 100644 (file)
@@ -147,7 +147,8 @@ class Assign:
                self.r = _cst(r)
 
 class StatementList:
-       def __init__(self, l=[]):
+       def __init__(self, l=None):
+               if l is None: l = []
                self.l = l
 
 def _sl(x):
@@ -194,7 +195,10 @@ class Instance:
                return id(self)
 
 class Fragment:
-       def __init__(self, comb=[], sync=[], instances=[], pads=set()):
+       def __init__(self, comb=None, sync=None, instances=None, pads=set()):
+               if comb is None: comb = []
+               if sync is None: sync = []
+               if instances is None: instances = []
                self.comb = _sl(comb)
                self.sync = _sl(sync)
                self.instances = instances