Skip to content

Commit 7d52079

Browse files
committed
Merged revisions 75272-75273 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75272 | amaury.forgeotdarc | 2009-10-06 21:56:32 +0200 (mar., 06 oct. 2009) | 5 lines #1571184: makeunicodedata.py now generates the functions _PyUnicode_ToNumeric, _PyUnicode_IsLinebreak and _PyUnicode_IsWhitespace. It now also parses the Unihan.txt for numeric values. ........ r75273 | amaury.forgeotdarc | 2009-10-06 22:02:09 +0200 (mar., 06 oct. 2009) | 2 lines Add Anders Chrigstrom to Misc/ACKS for his work on unicodedata. ........
1 parent e1b60d4 commit 7d52079

8 files changed

Lines changed: 3293 additions & 1938 deletions

File tree

Lib/test/test_unicodedata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class UnicodeMethodsTest(unittest.TestCase):
2222

2323
# update this, if the database changes
24-
expectedchecksum = '6ec65b65835614ec00634c674bba0e50cd32c189'
24+
expectedchecksum = '0b915116051f3ed029a98542c2b7df63c9646272'
2525

2626
def test_method_checksum(self):
2727
h = hashlib.sha1()
@@ -80,7 +80,7 @@ def tearDown(self):
8080
class UnicodeFunctionsTest(UnicodeDatabaseTest):
8181

8282
# update this, if the database changes
83-
expectedchecksum = '3136d5afd787dc2bcb1bdcac95e385349fbebbca'
83+
expectedchecksum = 'd4169ccff998ebbd1ec007a0b3fbd66e5ccf0229'
8484

8585
def test_function_checksum(self):
8686
data = []
@@ -119,6 +119,7 @@ def test_numeric(self):
119119
self.assertEqual(self.db.numeric('9'), 9)
120120
self.assertEqual(self.db.numeric('\u215b'), 0.125)
121121
self.assertEqual(self.db.numeric('\u2468'), 9.0)
122+
self.assertEqual(self.db.numeric('\ua627'), 7.0)
122123
self.assertEqual(self.db.numeric('\U00020000', None), None)
123124

124125
self.assertRaises(TypeError, self.db.numeric)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Michael Chermside
131131
Albert Chin-A-Young
132132
Adal Chiriliuc
133133
Matt Chisholm
134+
Anders Chrigström
134135
Tom Christiansen
135136
Vadim Chugunov
136137
David Cinege

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ What's New in Python 3.2 Alpha 1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #1571184: The Unicode database contains properties for more characters.
16+
The tables for code points representing numeric values, white spaces or line
17+
breaks are now generated from the official Unicode Character Database files,
18+
and include information from the Unihan.txt file.
19+
1520
- Issue #7019: Raise ValueError when unmarshalling bad long data, instead
1621
of producing internally inconsistent Python longs.
1722

Modules/unicodedata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef struct change_record {
3636
const unsigned char category_changed;
3737
const unsigned char decimal_changed;
3838
const unsigned char mirrored_changed;
39-
const int numeric_changed;
39+
const double numeric_changed;
4040
} change_record;
4141

4242
/* data file generated by Tools/unicode/makeunicodedata.py */

Modules/unicodedata_db.h

Lines changed: 244 additions & 130 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)