mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Avoid TypeError by not comparing complex numbers
This commit is contained in:
parent
91007e2572
commit
64b3c830d4
1 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue