A port of InteractiveEditor to Python from Giles Bowkett's Utility Belt ruby gem.