mirror of https://github.com/python/cpython
Avoid TypeError by not comparing complex numbers
This commit is contained in:
parent
91007e2572
commit
64b3c830d4
|
@ -301,7 +301,12 @@ def test():
|
||||||
print complex(i)
|
print complex(i)
|
||||||
print
|
print
|
||||||
for j in list:
|
for j in list:
|
||||||
print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
|
print i + j, i - j, i * j, i / j, i ** j,
|
||||||
|
if not (isinstance(i, ComplexType) or
|
||||||
|
isinstance(j, ComplexType)):
|
||||||
|
print cmp(i, j)
|
||||||
|
print
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
test()
|
test()
|
||||||
|
|
Loading…
Reference in New Issue