1.1 --- a/lib/__builtins__/complex.py Thu Nov 24 00:29:06 2016 +0100
1.2 +++ b/lib/__builtins__/complex.py Thu Nov 24 00:58:36 2016 +0100
1.3 @@ -19,7 +19,10 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 -class complex(object):
1.8 +class complex:
1.9 +
1.10 + "A complex number representation."
1.11 +
1.12 def __init__(self, real, imag=None):
1.13 self.real = real
1.14 self.imag = imag
1.15 @@ -51,7 +54,15 @@
1.16 def __neg__(self): pass
1.17 def __pos__(self): pass
1.18 def __str__(self): pass
1.19 - def __bool__(self): pass
1.20 +
1.21 + __repr__ = __str__
1.22 +
1.23 + def __bool__(self):
1.24 +
1.25 + "Return a boolean interpretation of the number."
1.26 +
1.27 + return self.real and self.imag
1.28 +
1.29 def conjugate(self): pass
1.30
1.31 # vim: tabstop=4 expandtab shiftwidth=4