[Python-ideas] Add \e escape code

Steven D'Aprano steve at pearwood.info
Tue Jun 11 18:22:25 CEST 2013

Should Python support \e in strings for the ESC control character, ASCII 0x1B (27)?

\e is supported by Perl, PHP, Ruby, and although it is not standard C, gcc:


I have the Python Pocket Reference, by Mark Lutz, 1st Edition from 1998, which lists \e as a string escape code. I don't know if that was a mistake, or if \e used to be supported prior to 1.5 but was then removed.


More information about the Python-ideas mailing list