mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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
This commit is contained in:
parent
b5047fd019
commit
e9ddfbb412
15 changed files with 1641 additions and 1617 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue