summaryrefslogtreecommitdiffstats
path: root/Demo/classes/Rat.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/classes/Rat.py')
-rwxr-xr-xDemo/classes/Rat.py7
1 files changed, 6 insertions, 1 deletions
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 @@ 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()