Commit 10daac87 authored by Jason Swails's avatar Jason Swails
Browse files

Better fix.

parent 8e346de8
...@@ -604,7 +604,7 @@ class Quantity(object): ...@@ -604,7 +604,7 @@ class Quantity(object):
return bool(self._value) return bool(self._value)
def __bool__(self): def __bool__(self):
return self.__nonzero__() return bool(self._value)
def __complex__(self): def __complex__(self):
return Quantity(complex(self._value), self.unit) return Quantity(complex(self._value), self.unit)
...@@ -819,9 +819,6 @@ def _is_string(x): ...@@ -819,9 +819,6 @@ def _is_string(x):
except StopIteration: except StopIteration:
return False return False
if sys.version_info >= (3,):
del Quantity.__nonzero__
# run module directly for testing # run module directly for testing
if __name__=='__main__': if __name__=='__main__':
# Test the examples in the docstrings # Test the examples in the docstrings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment