Skip to content

Commit 286092b

Browse files
fallensbourdeauducq
authored andcommittedOct 27, 2014
Raise exception when not using correct boolean operators
1 parent 86abb25 commit 286092b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎migen/fhdl/structure.py

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Value(HUID):
2424
Values created from integers have the minimum bit width to necessary to
2525
represent the integer.
2626
"""
27+
def __bool__(self):
28+
raise NotImplementedError("For boolean operations between expressions: use '&'/'|' instead of 'and'/'or'")
29+
2730
def __invert__(self):
2831
return _Operator("~", [self])
2932
def __neg__(self):

0 commit comments

Comments
 (0)
Please sign in to comment.