mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Remove length limitation on string arguments to complex()
This commit is contained in:
parent
f0966c9568
commit
f972488213
3 changed files with 16 additions and 8 deletions
|
@ -284,7 +284,6 @@ class ComplexTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, complex, "1+2j)")
|
||||
self.assertRaises(ValueError, complex, "1+(2j)")
|
||||
self.assertRaises(ValueError, complex, "(1+2j)123")
|
||||
self.assertRaises(ValueError, complex, "1"*500)
|
||||
self.assertRaises(ValueError, complex, "x")
|
||||
self.assertRaises(ValueError, complex, "1j+2")
|
||||
self.assertRaises(ValueError, complex, "1e1ej")
|
||||
|
@ -295,6 +294,9 @@ class ComplexTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, complex, "1.11.1j")
|
||||
self.assertRaises(ValueError, complex, "1e1.1j")
|
||||
|
||||
# check that complex accepts long unicode strings
|
||||
self.assertEqual(type(complex("1"*500)), complex)
|
||||
|
||||
class EvilExc(Exception):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue