svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r68529 | mark.dickinson | 2009-01-11 11:54:02 +0000 (Sun, 11 Jan 2009) | 2 lines
Remove __long__ methods from UserString and from Demo/ classes.
........
#
# These conversions accept complex arguments only if their imaginary part is zero:
# int(z)
-# long(z)
# float(z)
#
# The following operators accept two complex numbers, or one complex number
raise ValueError("can't convert Complex with nonzero im to int")
return int(self.re)
- def __long__(self):
- if self.im:
- raise ValueError("can't convert Complex with nonzero im to long")
- return int(self.re)
-
def __float__(self):
if self.im:
raise ValueError("can't convert Complex with nonzero im to float")
def __int__(self):
return int(self._data)
- def __long__(self):
- return int(self._data)
-
def __float__(self):
return float(self._data)
def __str__(self): return str(self.data)
def __repr__(self): return repr(self.data)
def __int__(self): return int(self.data)
- def __long__(self): return int(self.data)
def __float__(self): return float(self.data)
def __complex__(self): return complex(self.data)
def __hash__(self): return hash(self.data)