diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-09-23 20:16:03 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-09-23 20:16:03 (GMT) |
commit | a67c70d4a945e9fc5f37165d1c61e6955e0dc8c8 (patch) | |
tree | 2c6e02c4f8a2b6059ce9e971f880102055f8d7d5 /Lib | |
parent | 9227508dec49240d3e528d0a319048a3a2cb02c6 (diff) | |
download | cpython-a67c70d4a945e9fc5f37165d1c61e6955e0dc8c8.zip cpython-a67c70d4a945e9fc5f37165d1c61e6955e0dc8c8.tar.gz cpython-a67c70d4a945e9fc5f37165d1c61e6955e0dc8c8.tar.bz2 |
Merged revisions 84984 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84984 | mark.dickinson | 2010-09-23 21:11:19 +0100 (Thu, 23 Sep 2010) | 5 lines
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')
-rw-r--r-- | Lib/test/test_descr.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 82dcc2c..320a7a7 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -289,6 +289,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... |