remove property polynomial
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Apr 2019 10:30:40 +0000 (11:30 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Apr 2019 10:30:40 +0000 (11:30 +0100)
(why assign __polynomial then add extra code where property polynomial
*returns* __polynomial?  just... assign polynomial to self)

TLB/src/LFSR2.py
TLB/src/LFSR2.pyi

index 7031227231c27291f04d765ef03fc06af93b1658..6d2a97c6fc08ef571fd8cca03977b62a2ee00898 100644 (file)
@@ -71,14 +71,10 @@ LFSR_POLY_24 = LFSRPolynomial([24, 23, 22, 17, 0])
 
 class LFSR:
     def __init__(self, polynomial):
-        self.__polynomial = LFSRPolynomial(polynomial)
+        self.polynomial = LFSRPolynomial(polynomial)
         self.state = Signal(self.width, reset=1)
         self.enable = Signal(1, reset=1)
 
-    @property
-    def polynomial(self):
-        return self.__polynomial
-
     @property
     def width(self):
         return self.polynomial.max_exponent
index 894ce23fd4ea9ef1287b90a3e5abea7e39d50807..64eb91152417d33ac1d9907629220df3b4525c89 100644 (file)
@@ -19,7 +19,5 @@ class LFSRPolynomial(set):
 class LFSR:
     def __init__(self, polynomial: Union[Iterable[int], LFSRPolynomial]): ...
     @property
-    def polynomial(self) -> LFSRPolynomial: ...
-    @property
     def width(self) -> int: ...
     def elaborate(self, platform: Any) -> Module: ...