I am trying to create a more complicated boolean function that I'll use between functions. Here is the simplified problem:
a = "1 == 2"
if a:
print ("it is not working")
else:
print ("it worked")
Out[1]:
it is not working
Basically I am trying to pass a function as a string and use that in a boolean later on but it turns out as True always.
I also tried:
bool(a)
Out[1]: True
ast.literal_eval