From: whitequark Date: Sat, 12 Dec 2020 14:11:40 +0000 (+0000) Subject: hdl.ast: formatting. NFC. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0843d9f596a13aa63260e01bdcdbc72d0504ac8b;p=nmigen.git hdl.ast: formatting. NFC. --- diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index 5cdbf6e..b410844 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -1290,19 +1290,20 @@ class ValueCastable: Note that it is necessary to ensure that nMigen's view of representation of all values stays internally consistent. The class deriving from ``ValueCastable`` must decorate the ``as_value`` - method with the ``lowermethod`` decorator, which ensures that all calls to ``as_value``return the - same ``Value`` representation. If the class deriving from ``ValueCastable`` is mutable, it is - up to the user to ensure that it is not mutated in a way that changes its representation after - the first call to ``as_value``. + method with the ``lowermethod`` decorator, which ensures that all calls to ``as_value`` return + the same ``Value`` representation. If the class deriving from ``ValueCastable`` is mutable, + it is up to the user to ensure that it is not mutated in a way that changes its representation + after the first call to ``as_value``. """ def __new__(cls, *args, **kwargs): self = super().__new__(cls) if not hasattr(self, "as_value"): - raise TypeError(f"Class '{cls.__name__}' deriving from `ValueCastable` must override the `as_value` method") + raise TypeError(f"Class '{cls.__name__}' deriving from `ValueCastable` must override " + "the `as_value` method") if not hasattr(self.as_value, "_ValueCastable__memoized"): - raise TypeError(f"Class '{cls.__name__}' deriving from `ValueCastable` must decorate the `as_value` " - "method with the `ValueCastable.lowermethod` decorator") + raise TypeError(f"Class '{cls.__name__}' deriving from `ValueCastable` must decorate " + "the `as_value` method with the `ValueCastable.lowermethod` decorator") return self @staticmethod