mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* Add clearer comment to initialization code.
* Add optional argument to popitem() -- modeled after Anthon van der Neut's C version. * Fix method markup in docs.
This commit is contained in:
parent
a0b8d9ad2d
commit
2412299be9
3 changed files with 20 additions and 5 deletions
|
@ -768,12 +768,19 @@ class TestOrderedDict(unittest.TestCase):
|
|||
class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
|
||||
type2test = OrderedDict
|
||||
|
||||
def test_popitem(self):
|
||||
d = self._empty_mapping()
|
||||
self.assertRaises(KeyError, d.popitem)
|
||||
|
||||
class MyOrderedDict(OrderedDict):
|
||||
pass
|
||||
|
||||
class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
|
||||
type2test = MyOrderedDict
|
||||
|
||||
def test_popitem(self):
|
||||
d = self._empty_mapping()
|
||||
self.assertRaises(KeyError, d.popitem)
|
||||
|
||||
import doctest, collections
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue