From 2ec38a17d4e357f8f12ee6a2643e2dd2ff7a426e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 13 Jun 2014 21:23:00 +0300 Subject: objstr: Be 8-bit clean even for repr(). This will allow roughly the same behavior as Python3 for non-ASCII strings, for example, print("".split()) will print list of words, not weird hex dump (like Python2 behaves). (Of course, that it will print list of words, if there're "words" in that phrase at all, separated by ASCII-compatible whitespace; that surely won't apply to every human language in existence). --- tests/basics/string-repr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/basics/string-repr.py') diff --git a/tests/basics/string-repr.py b/tests/basics/string-repr.py index 34da483a5..2a3ef2527 100644 --- a/tests/basics/string-repr.py +++ b/tests/basics/string-repr.py @@ -1,3 +1,4 @@ # anything above 0xa0 is printed as Unicode by CPython -for c in range(0xa1): +# the abobe is CPython implementation detail, stick to ASCII +for c in range(0x80): print("0x%02x: %s" % (c, repr(chr(c)))) -- cgit v1.2.3