mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Replace occurrences of '\d' with '[0-9]' in Decimal regex, to make sure
that the behaviour of Decimal doesn't change if/when re.UNICODE becomes
assumed in Python 3.0.
Also add a check that alternative Unicode digits (e.g. u'\N{FULLWIDTH
DIGIT ONE}') are *not* accepted in a numeric string.
This commit is contained in:
parent
8bb8fa5dd6
commit
70c3289085
2 changed files with 13 additions and 10 deletions
|
|
@ -432,6 +432,9 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
|
|||
self.assertEqual(str(Decimal(u'-Inf')), '-Infinity')
|
||||
self.assertEqual(str(Decimal(u'NaN123')), 'NaN123')
|
||||
|
||||
#but alternate unicode digits should not
|
||||
self.assertEqual(str(Decimal(u'\uff11')), 'NaN')
|
||||
|
||||
def test_explicit_from_tuples(self):
|
||||
|
||||
#zero
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue