comment clarification, add missing default value "stride=1" to Value.__Part__
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Oct 2021 17:19:51 +0000 (18:19 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Oct 2021 17:19:51 +0000 (18:19 +0100)
nmigen/hdl/ast.py

index ef4a5dfbb61fd70511df8bd9443744d8850e07f2..372148205697a78280cee4c84cdf20ff2ec173e4 100644 (file)
@@ -155,10 +155,12 @@ class Value(metaclass=ABCMeta):
     # These are redirection of "Type (1) - AST " nmigen language constructs
     # If over-ridden to provide advanced behaviour, the implementation
     # *MUST NOT* use "Type (2) - dsl.Module" nmigen language constructs
-    # (m.If, m.Else, m.Switch, m.FSM): it creates complications in dsl.Module.
+    # (m.If, m.Else, m.Switch, m.FSM): it creates complications
+    # (recursive dependencies) in dsl.Module.
 
-    def __Part__(self, offset, width, stride, *, src_loc_at=0):
-        return _InternalPart(self, offset, width, stride, src_loc_at=src_loc_at)
+    def __Part__(self, offset, width, stride=1, *, src_loc_at=0):
+        return _InternalPart(self, offset, width, stride,
+                             src_loc_at=src_loc_at)
     def __Repl__(self, count, *, src_loc_at=0):
         return _InternalRepl(self, count, src_loc_at=src_loc_at)
     def __Cat__(self, *args, src_loc_at=0):