summaryrefslogtreecommitdiff
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-09-23 20:11:19 +0000
committerMark Dickinson <dickinsm@gmail.com>2010-09-23 20:11:19 +0000
commitb09a3d69a614c767653a12428d1ac816f516f36e (patch)
tree9a1c0f9ee8a6ebf0ba0ee357914b8ecde36fa3d7 /Lib/test/test_descr.py
parente8e4b3bfd65582564b5933dcb4d0cdb3157884dc (diff)
downloadcpython-git-b09a3d69a614c767653a12428d1ac816f516f36e.tar.gz
Issue #9930: Remove an unnecessary type check in wrap_binaryfunc_r;
this was causing reversed method calls like float.__radd__(3.0, 1) to return NotImplemented instead of the expected numeric value.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 09798802f3..47fecfe34f 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -285,6 +285,11 @@ class OperatorsTest(unittest.TestCase):
self.assertEqual(repr(a), "234.5")
self.assertEqual(a.prec, 12)
+ def test_explicit_reverse_methods(self):
+ # see issue 9930
+ self.assertEqual(complex.__radd__(3j, 4.0), complex(4.0, 3.0))
+ self.assertEqual(float.__rsub__(3.0, 1), -2.0)
+
@support.impl_detail("the module 'xxsubtype' is internal")
def test_spam_lists(self):
# Testing spamlist operations...