mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
count() should return integers #10474
This commit is contained in:
parent
2e579f0a87
commit
0b458d52f9
3 changed files with 6 additions and 2 deletions
|
@ -1033,6 +1033,8 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertEqual(range(3).count(1), 1)
|
||||
self.assertEqual(range(3).count(2), 1)
|
||||
self.assertEqual(range(3).count(3), 0)
|
||||
self.assertIs(type(range(3).count(-1)), int)
|
||||
self.assertIs(type(range(3).count(1)), int)
|
||||
|
||||
self.assertEqual(range(10**20).count(1), 1)
|
||||
self.assertEqual(range(10**20).count(10**20), 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue