avoid looking like a singleton pattern
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Jun 2020 12:17:36 +0000 (13:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Jun 2020 12:17:36 +0000 (13:17 +0100)
nmigen_soc/wishbone/sram.py

index 451f948..630b53c 100644 (file)
@@ -46,7 +46,9 @@ class SRAM(Elaboratable):
     """
 
     def __init__(self, memory, read_only=False, bus=None,
-                 granularity=None, features=frozenset()):
+                 granularity=None, features=None):
+        if features is None:
+            features = frozenset()
         if not isinstance(memory, Memory):
             raise TypeError("Memory {!r} is not a Memory"
                             .format(memory))