summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/classes/Complex.py2
-rwxr-xr-xDemo/classes/Rat.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Demo/classes/Complex.py b/Demo/classes/Complex.py
index a779897..2019cdf 100755
--- a/Demo/classes/Complex.py
+++ b/Demo/classes/Complex.py
@@ -165,7 +165,7 @@ class Complex:
other = ToComplex(other)
return cmp(other, self)
- def __nonzero__(self):
+ def __bool__(self):
return not (self.re == self.im == 0)
abs = radius = __abs__
diff --git a/Demo/classes/Rat.py b/Demo/classes/Rat.py
index 55543b6..24670b6 100755
--- a/Demo/classes/Rat.py
+++ b/Demo/classes/Rat.py
@@ -223,7 +223,7 @@ class Rat:
return cmp(Rat(a), b)
# a != 0
- def __nonzero__(a):
+ def __bool__(a):
return a.__num != 0
# coercion