Python preprocesser that allows "until" and "unless" statements
Remco Gerlich is quite right to point out that this preprocessor does not work on general Python code, because it uses string replacement. Thus unless will be changed to if not in strings (such as regular expressions, templates, and docstrings), potentially breaking the code. The preprocessor itself is just one example of the kind of code which will be broken: it is not good enough to respond that this concern is "silly".
Additionally, Bakuriu is quite right to point out that the transformation of unless to if not is inadequate: it only works on very simple examples. But consider:

a unless b or c else d


which would be changed to:

a if not b or c else d


where the condition is wrong, because not b or c parses as (not b) or c. The correct transformation is:

a if not (b or c) else d


This problem makes it hopeless to attempt this preprocessing at the level of text, or even of tokens: you need a parser to find the end of the condition. Consider an expression like:

a unless b or (c unless d and e else f) else g


which needs to be transformed into:

a if not (b or (c if not (d and e) else f)) else g