]> granicus.if.org Git - python/commitdiff
Issue #27431: Update default protocol version in shelve.Shelf() documentation
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 1 Jul 2016 09:33:00 +0000 (12:33 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 1 Jul 2016 09:33:00 +0000 (12:33 +0300)
shelve.open() documentation was updated in f351fb7ea179.

Doc/library/shelve.rst
Lib/test/test_shelve.py

index 1ec158ee7e3141cf4265ae97e79cb05d8066e4db..db66a63843dbb721c1e1fc3f3b2fc2f49e4764e2 100644 (file)
@@ -108,7 +108,7 @@ Restrictions
    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.
 
index bd51d868fee3baaf83d1729e8544075fe7b146b4..b71af2bac7403384551047e6212c513991e2c266 100644 (file)
@@ -162,6 +162,10 @@ class TestCase(unittest.TestCase):
         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):