commit 5b8256ce1832cb387bb567143309c4b543d62bd9 Author: Emily <18535642+emilazy@users.noreply.github.com> Date: Tue Feb 19 00:11:43 2019 +0100 hdl.ast: remove unnecessary definition of __hash__. "A class that overrides __eq__() and does not define __hash__() will have its __hash__() implicitly set to None." -- https://docs.python.org/3.7/reference/datamodel.html#object.__hash__ diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index 3dd8809..0ebde34 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -207,8 +207,6 @@ class Value(metaclass=ABCMeta): def _as_const(self): raise TypeError("Value {!r} cannot be evaluated as constant".format(self)) - __hash__ = None - class Const(Value): """A constant, literal integer value. commit bfc920e873db38cc8c4f6a314073f337c611969c Author: Emily <18535642+emilazy@users.noreply.github.com> Date: Tue Feb 19 00:25:00 2019 +0100 test.test_hdl_ast: remove duplicate test_bool definition. diff --git a/nmigen/test/test_hdl_ast.py b/nmigen/test/test_hdl_ast.py index 9f20d17..a20c8d7 100644 --- a/nmigen/test/test_hdl_ast.py +++ b/nmigen/test/test_hdl_ast.py @@ -238,11 +238,6 @@ class OperatorTestCase(FHDLTestCase): v4 = Mux(s, Const(0, (4, False)), Const(0, (4, True))) self.assertEqual(v4.shape(), (5, True)) - def test_bool(self): - v = Const(0).bool() - self.assertEqual(repr(v), "(b (const 1'd0))") - self.assertEqual(v.shape(), (1, False)) - def test_hash(self): with self.assertRaises(TypeError): hash(Const(0) + Const(0))