is it possible to define programmatically some Python operators like &
or |
?
Something like the below would be ideal
logical_op = '|'
var1 = var2 = True
eval(f'var1 {logical_op} var2')
eval execution should return True
is it possible to define programmatically some Python operators like &
or |
?
Something like the below would be ideal
logical_op = '|'
var1 = var2 = True
eval(f'var1 {logical_op} var2')
eval execution should return True