Python eval is quite slow. I need to evaluate simple boolean expression with logical operators (like "True or False"). I am doing this for thousands of line of data and eval is a huge bottleneck in terms of performance. It's really slow.. Any alternative approaches?
I tried creating a dict of possible expression combinations and their expected output, but this is really ugly!
I have the following code at the moment:
eval('%s %s %s' % (True, operator, False))