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 451f948f724bda356c72425184a3196ecac5efef..630b53c090bbd0ffe5141c72bfef2e56558da4a9 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))