guido van rossum hoaufpythonorg tue apr 15 2008 610 pm michael urman wrote agree enoguh see two main uses repr comes strings put quotes around contents replace control characters safe representations interpreter understands third use represent strings unambiguously major point much dependent looking clearly serviced tell via repr string1 string2 equal nobody asked red herring strings dont compare meaningfully identity value first quotes disambiguates values lists containing strings commas second backslash replaced control characters avoids using characters special meanings latter also historically disambiguates everything beyond ascii practice useful mystring 0x12345678 similarly useful 日本語 u1234u5678u9abc thats universally true cases become visually ambiguous still pass ideal case evalreprs finally atsuo ishimotos encodeascii backslashreplace much explicit expectations handles identifying whether combined character base combining diacritic etc string_escape codec repr changed assuming internally linked directly repr see benefits matching repr benefits like asciibackslashreplace dont strong preference like repr think believe repr changed instead give people like see 日本語 instead u1234u5678u9abc tools help guido van rossum home page httpwwwpythonorgguido thu 07 aug 2008 093732 0700 python3000 recursive str