Is it possible to somehow cast a string of, say, or or and into a form that is recognizable as a logical operator?
For example, is it possible to do something like this:
l = [1, 2, 3, 4, 5]
o = {item1:'or'}
for i in l:
if i > 4 o[item1] i < 0:
print i
where o[item1] is recognized as a valid or logical operator?
(i > 4) |o[item1]| (i < 0)syntax to work (without short-circuiting) but you'd never use that in any real code so it's not much more than a parlour trick. Is there a particular problem you think this would help with? Maybe there's a better way to solve it.a <o[x]> bora **o[x]** bor evena %o[x]% b...the possibilities are endless! :P