mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #10557: Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
This commit is contained in:
parent
36526bf3d9
commit
942af5a9a4
11 changed files with 169 additions and 52 deletions
|
@ -220,6 +220,7 @@ class ComplexTest(unittest.TestCase):
|
|||
self.assertEqual(complex(NS(1+10j)), 1+10j)
|
||||
self.assertRaises(TypeError, complex, OS(None))
|
||||
self.assertRaises(TypeError, complex, NS(None))
|
||||
self.assertRaises(TypeError, complex, {})
|
||||
|
||||
self.assertAlmostEqual(complex("1+10j"), 1+10j)
|
||||
self.assertAlmostEqual(complex(10), 10+0j)
|
||||
|
@ -325,6 +326,8 @@ class ComplexTest(unittest.TestCase):
|
|||
|
||||
# check that complex accepts long unicode strings
|
||||
self.assertEqual(type(complex("1"*500)), complex)
|
||||
# check whitespace processing
|
||||
self.assertEqual(complex('\N{EM SPACE}(\N{EN SPACE}1+1j ) '), 1+1j)
|
||||
|
||||
class EvilExc(Exception):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue