A subclass of :class:`collections.abc.MutableMapping` which stores pickled
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
:mod:`pickle` documentation for a discussion of the pickle protocols.
else:
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
class TestShelveBase(mapping_tests.BasicTestMappingProtocol):