repr() of containers with non-ASCII strings (Python recipe) by Christos Georgiou Printing sequences or maps containing non-ASCII strings results in escape sequences. This function uses the not-so-commonly-known "string_escape" codec to facilitate printing such sequences for quick-viewing.