summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-01-15 19:32:23 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-01-15 19:32:23 (GMT)
commitcce2f217d403dff7344fcc1c381e36dfd075a961 (patch)
tree87189334129e9ca408a823ea98d3b1dd512addd3 /Lib/test
parent29500f64b609e312e72150f0539c4508d650656b (diff)
downloadcpython-cce2f217d403dff7344fcc1c381e36dfd075a961.zip
cpython-cce2f217d403dff7344fcc1c381e36dfd075a961.tar.gz
cpython-cce2f217d403dff7344fcc1c381e36dfd075a961.tar.bz2
Issue 4910, patch 2 of (probably) 3: pave the way for renaming of
nb_long: remove last remaining use of nb_long (in the struct module) from the core, set nb_long slots on all builtin and extension types to 0, and remove uses of __long__ in test_complex and test_binop. Reviewed by Benjamin Peterson.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_binop.py6
-rwxr-xr-xLib/test/test_cmath.py4
2 files changed, 1 insertions, 9 deletions
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index f60fe3f..0dc18dd 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -77,12 +77,6 @@ class Rat(object):
repr(self))
raise ValueError("can't convert %s to int" % repr(self))
- def __long__(self):
- """Convert a Rat to an long; self.den must be 1."""
- if self.__den == 1:
- return int(self.__num)
- raise ValueError("can't convert %s to long" % repr(self))
-
def __add__(self, other):
"""Add two Rats, or a Rat and a number."""
if isint(other):
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index 3c34fec..17cb566 100755
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -182,11 +182,9 @@ class CMathTests(unittest.TestCase):
pass
class MyInt(object):
def __int__(self): return 2
- def __long__(self): return 2
def __index__(self): return 2
class MyIntOS:
def __int__(self): return 2
- def __long__(self): return 2
def __index__(self): return 2
# other possible combinations of __float__ and __complex__
@@ -219,7 +217,7 @@ class CMathTests(unittest.TestCase):
self.assertEqual(f(JustFloatOS()), f(flt_arg))
# TypeError should be raised for classes not providing
# either __complex__ or __float__, even if they provide
- # __int__, __long__ or __index__. An old-style class
+ # __int__ or __index__. An old-style class
# currently raises AttributeError instead of a TypeError;
# this could be considered a bug.
self.assertRaises(TypeError, f, NeitherComplexNorFloat())