From 72ef4303a90a8371213f0907cfe9a17468bb0e73 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 19 May 2020 23:43:25 +0000 Subject: [PATCH] hdl.ast: clarify docs for Value.rotate_{left,right}. "Rotate modulo 2**len(self)" is redundant because that's just how rotates work. --- nmigen/hdl/ast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index e5ade85..a7f77e2 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -424,7 +424,7 @@ class Value(metaclass=ABCMeta): return Cat(*matches).any() def rotate_left(self, offset): - """Rotate left by constant modulo 2**len(self). + """Rotate left by constant amount. Parameters ---------- @@ -434,7 +434,7 @@ class Value(metaclass=ABCMeta): Returns ------- Value, out - The input rotated left by offset if offset is positive, else the input rotated right by -offset. + If the offset is positive, the input rotated left. Otherwise, the input rotated right. """ if not isinstance(offset, int): raise TypeError("Rotate amount must be an integer, not {!r}".format(offset)) @@ -442,7 +442,7 @@ class Value(metaclass=ABCMeta): return Cat(self[-offset:], self[:-offset]) # meow :3 def rotate_right(self, offset): - """Rotate right by constant modulo 2**len(self). + """Rotate right by constant amount. Parameters ---------- @@ -452,7 +452,7 @@ class Value(metaclass=ABCMeta): Returns ------- Value, out - The input rotated right by offset if offset is positive, else the input rotated left by -offset. + If the offset is positive, the input rotated right. Otherwise, the input rotated right. """ if not isinstance(offset, int): raise TypeError("Rotate amount must be an integer, not {!r}".format(offset)) -- 2.30.2