Merged revisions 75470 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75470 | mark.dickinson | 2009-10-17 22:46:32 +0100 (Sat, 17 Oct 2009) | 1 line

  Protect against attempts to replace PyNumber_Add with PyNumber_InPlaceAdd in builtin sum
........
This commit is contained in:
Mark Dickinson 2009-10-17 21:48:16 +00:00
parent d412ab5260
commit 3a22b476a3
1 changed files with 4 additions and 0 deletions

View File

@ -1151,6 +1151,10 @@ class BuiltinTest(unittest.TestCase):
raise ValueError
self.assertRaises(ValueError, sum, BadSeq())
empty = []
sum(([x] for x in range(10)), empty)
self.assertEqual(empty, [])
def test_type(self):
self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(()))