commit | 64b3c830d44aaeac8de85067113b03bc62a92957 | [log] [tgz] |
---|---|---|
author | Andrew M. Kuchling <amk@amk.ca> | Thu Apr 24 16:59:45 2003 +0000 |
committer | Andrew M. Kuchling <amk@amk.ca> | Thu Apr 24 16:59:45 2003 +0000 |
tree | 364081117be8e6a48141a16c620bc6d8bbc3f262 | |
parent | 91007e257201889d28a88b4f0802e8112a01e1bf [diff] [blame] |
Avoid TypeError by not comparing complex numbers
diff --git a/Demo/classes/Rat.py b/Demo/classes/Rat.py index 4fc4a17..9e0c05d 100755 --- a/Demo/classes/Rat.py +++ b/Demo/classes/Rat.py
@@ -301,7 +301,12 @@ 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()