diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2004-08-04 07:38:35 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2004-08-04 07:38:35 (GMT) |
commit | e9ddfbb41207328d5c89061067f3431e00711fda (patch) | |
tree | 54093161fe6808de7d6fcc3304eb32241231f010 /Lib/test/test_unicode.py | |
parent | b5047fd01948ab108edcc1b3c2c901d915814cfd (diff) | |
download | cpython-e9ddfbb41207328d5c89061067f3431e00711fda.zip cpython-e9ddfbb41207328d5c89061067f3431e00711fda.tar.gz cpython-e9ddfbb41207328d5c89061067f3431e00711fda.tar.bz2 |
SF #989185: Drop unicode.iswide() and unicode.width() and add
unicodedata.east_asian_width(). You can still implement your own
simple width() function using it like this:
def width(u):
w = 0
for c in unicodedata.normalize('NFC', u):
cwidth = unicodedata.east_asian_width(c)
if cwidth in ('W', 'F'): w += 2
else: w += 1
return w
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 17c82ab..215c968 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -11,8 +11,7 @@ from test import test_support, string_tests class UnicodeTest( string_tests.CommonTest, - string_tests.MixinStrUnicodeUserStringTest, - string_tests.MixinUnicodeUserStringTest + string_tests.MixinStrUnicodeUserStringTest ): type2test = unicode |