I'd prefer a more interesting example. E.g., using my proposed stream API,

    def to_british(tokens):
        """Heuristic British->American spelling converter."""
        for t in tokens:
            t = re.sub(r"our$", "or", t)
            t = re.sub(r"([bt])re$", r"\1er", t)
            t = re.sub(r"([iy])s(e$|ation)", r"\1z\2", t)
            t = re.sub(r"ogue$", "og", t)
            yield t