diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-02-26 18:55:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-02-26 18:55:48 (GMT) |
commit | efb06b0d91a6f7f4a34bd2dc46f4afbffdf49e0e (patch) | |
tree | 5ab5f2a98bec4f2f164928aace5e47a7cc810736 /Lib | |
parent | e3a29806449132490029fafa4cc1349d9d4077a8 (diff) | |
download | cpython-efb06b0d91a6f7f4a34bd2dc46f4afbffdf49e0e.zip cpython-efb06b0d91a6f7f4a34bd2dc46f4afbffdf49e0e.tar.gz cpython-efb06b0d91a6f7f4a34bd2dc46f4afbffdf49e0e.tar.bz2 |
Merged revisions 69811,69947 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69811 | collin.winter | 2009-02-20 13:30:41 -0600 (Fri, 20 Feb 2009) | 2 lines
Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example.
........
r69947 | jeffrey.yasskin | 2009-02-24 16:48:34 -0600 (Tue, 24 Feb 2009) | 3 lines
Tools/scripts/analyze_dxp.py, a module with some helper functions to
analyze the output of sys.getdxp().
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_opcodes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 8fe77ac..4403a11 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -98,6 +98,12 @@ class OpcodeTest(unittest.TestCase): g = eval('lambda a=1: None') self.assertNotEquals(f, g) + def test_modulo_of_string_subclasses(self): + class MyString(str): + def __mod__(self, value): + return 42 + self.assertEqual(MyString() % 3, 42) + def test_main(): run_unittest(OpcodeTest) |