We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
test_complex
1 parent bec1317 commit ee405e3Copy full SHA for ee405e3
Lib/test/test_complex.py
@@ -306,15 +306,10 @@ def test_conjugate(self):
306
self.assertClose(complex(5.3, 9.8).conjugate(), 5.3-9.8j)
307
308
def test_constructor(self):
309
- class OS:
+ class NS:
310
def __init__(self, value): self.value = value
311
def __complex__(self): return self.value
312
- class NS(object):
313
- def __init__(self, value): self.value = value
314
- def __complex__(self): return self.value
315
- self.assertEqual(complex(OS(1+10j)), 1+10j)
316
self.assertEqual(complex(NS(1+10j)), 1+10j)
317
- self.assertRaises(TypeError, complex, OS(None))
318
self.assertRaises(TypeError, complex, NS(None))
319
self.assertRaises(TypeError, complex, {})
320
self.assertRaises(TypeError, complex, NS(1.5))
0 commit comments