From 286092b62e69de90449865c206d59994f63be12d Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Mon, 27 Oct 2014 12:41:17 +0100 Subject: [PATCH] Raise exception when not using correct boolean operators --- migen/fhdl/structure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 2859345d..071ae23c 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -24,6 +24,9 @@ class Value(HUID): Values created from integers have the minimum bit width to necessary to represent the integer. """ + def __bool__(self): + raise NotImplementedError("For boolean operations between expressions: use '&'/'|' instead of 'and'/'or'") + def __invert__(self): return _Operator("~", [self]) def __neg__(self): -- 2.30.2