2016-12-14 | Paul Boddie | file changeset files shortlog | Attempt to interpret plain string literals as Unicode, returning constant types when encoding their values. Propagated the file encoding from the parser to each module in order to attempt string value interpretations. |
paul@2 | 1 | import operator |
paul@2 | 2 | |
paul@2 | 3 | def f(a, op, b): |
paul@2 | 4 | return op(a, b) |
paul@2 | 5 | |
paul@214 | 6 | print f(1, operator.add, 2) # 3 |
paul@214 | 7 | print f(1, operator.sub, 2) # -1 |