Commit 64b3c830 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Avoid TypeError by not comparing complex numbers

parent 91007e25
......@@ -301,7 +301,12 @@ def test():
print complex(i)
print
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__':
test()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment