Bool does not support rand/ror
Closed this issue · 3 comments
SolalPirelli commented
Given that BV
supports __radd__
, __rmul__
, and other reversed ops, shouldn't Bool
support __rand__
and __ror__
?
I could do a PR for this if adding these ops makes sense.
ltfish commented
We have not encountered any cases where we would need __rand__
and __ror__
for Bool
s. I'd rather not add new operators unless there is a real use case for them.
SolalPirelli commented
I encountered this while doing some work with claripy ASTs; in general, it's just a bit weird to not have them:
>>> claripy.false | True
<Bool True>
>>> True | claripy.false
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'bool' and 'Bool'
I don't think they need new operators, just using the existing or/and also as ror/rand.
rhelmot commented
Yeah this isn't very hard to fix. Thanks for reporting!