summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-03 17:18:26 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-03 17:18:26 (GMT)
commit84fc66dd020931c14be8b13fcbdb9a8f295141c9 (patch)
tree989d036b1f6f9297d475a166179ec92ff3c7aad9 /Lib/test/test_unicode.py
parentef87d6ed94780fe00250a551031023aeb2898365 (diff)
downloadcpython-84fc66dd020931c14be8b13fcbdb9a8f295141c9.zip
cpython-84fc66dd020931c14be8b13fcbdb9a8f295141c9.tar.gz
cpython-84fc66dd020931c14be8b13fcbdb9a8f295141c9.tar.bz2
Rename 'unicode' to 'str' in its tp_name field. Rename 'str' to 'str8'.
Change all occurrences of unichr to chr.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 125fd56..3dd92ae 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -90,7 +90,7 @@ class UnicodeTest(
"\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef"
"\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd"
"\\xfe\\xff'")
- testrepr = repr(''.join(map(unichr, xrange(256))))
+ testrepr = repr(''.join(map(chr, xrange(256))))
self.assertEqual(testrepr, latin1repr)
# Test repr works on wide unicode escapes without overflow.
self.assertEqual(repr("\U00010000" * 39 + "\uffff" * 4096),
@@ -632,7 +632,7 @@ class UnicodeTest(
# Roundtrip safety for BMP (just the first 1024 chars)
for c in xrange(1024):
- u = unichr(c)
+ u = chr(c)
for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le',
'utf-16-be', 'raw_unicode_escape',
'unicode_escape', 'unicode_internal'):
@@ -640,13 +640,13 @@ class UnicodeTest(
# Roundtrip safety for BMP (just the first 256 chars)
for c in xrange(256):
- u = unichr(c)
+ u = chr(c)
for encoding in ('latin-1',):
self.assertEqual(str(u.encode(encoding),encoding), u)
# Roundtrip safety for BMP (just the first 128 chars)
for c in xrange(128):
- u = unichr(c)
+ u = chr(c)
for encoding in ('ascii',):
self.assertEqual(str(u.encode(encoding),encoding), u)
@@ -661,7 +661,7 @@ class UnicodeTest(
# This excludes surrogates: in the full range, there would be
# a surrogate pair (\udbff\udc00), which gets converted back
# to a non-BMP character (\U0010fc00)
- u = ''.join(map(unichr, range(0,0xd800)+range(0xe000,0x10000)))
+ u = ''.join(map(chr, range(0,0xd800)+range(0xe000,0x10000)))
for encoding in ('utf-8',):
self.assertEqual(str(u.encode(encoding),encoding), u)