mirror of
https://github.com/python/cpython.git
synced 2025-09-19 15:10:58 +00:00
Issue #27431: Update default protocol version in shelve.Shelf() documentation
shelve.open() documentation was updated in f351fb7ea179.
This commit is contained in:
parent
e39682b076
commit
8faca61fec
2 changed files with 5 additions and 1 deletions
|
@ -108,7 +108,7 @@ Restrictions
|
||||||
A subclass of :class:`collections.abc.MutableMapping` which stores pickled
|
A subclass of :class:`collections.abc.MutableMapping` which stores pickled
|
||||||
values in the *dict* object.
|
values in the *dict* object.
|
||||||
|
|
||||||
By default, version 0 pickles are used to serialize values. The version of the
|
By default, version 3 pickles are used to serialize values. The version of the
|
||||||
pickle protocol can be specified with the *protocol* parameter. See the
|
pickle protocol can be specified with the *protocol* parameter. See the
|
||||||
:mod:`pickle` documentation for a discussion of the pickle protocols.
|
:mod:`pickle` documentation for a discussion of the pickle protocols.
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,10 @@ class TestCase(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
self.fail('Closed shelf should not find a key')
|
self.fail('Closed shelf should not find a key')
|
||||||
|
|
||||||
|
def test_default_protocol(self):
|
||||||
|
with shelve.Shelf({}) as s:
|
||||||
|
self.assertEqual(s._protocol, 3)
|
||||||
|
|
||||||
from test import mapping_tests
|
from test import mapping_tests
|
||||||
|
|
||||||
class TestShelveBase(mapping_tests.BasicTestMappingProtocol):
|
class TestShelveBase(mapping_tests.BasicTestMappingProtocol):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue