With a dict like so: cond = {'a': 1, 'b': 1, 'c': 1, 'A': 0, 'B', 0, 'C':0}
how would you make a boolean expression like this: bool = (('a' == 1) & ('A' == 0) | ('b' == 1) & ('B' == 0) | ('c' == 1) & ('C' == 0)) The fact that lowercase and uppercase keys are stringed together with & is intentional albeit the actual condition is a bit more tricky. I've tried several approaches using eval() on a string built from the dict but landed with just spelling it out literally. Any pointers welcome. Alex -- https://mail.python.org/mailman/listinfo/python-list