@@ -25,8 +25,9 @@ lots of shared sub-objects. The keys are ordinary strings.
25
25
database file is opened for reading and writing. The optional *flag * parameter
26
26
has the same interpretation as the *flag * parameter of :func: `dbm.open `.
27
27
28
- By default, version 3 pickles are used to serialize values. The version of the
29
- pickle protocol can be specified with the *protocol * parameter.
28
+ By default, pickles created with :data: `pickle.DEFAULT_PROTOCOL ` are used
29
+ to serialize values. The version of the pickle protocol can be specified
30
+ with the *protocol * parameter.
30
31
31
32
Because of Python semantics, a shelf cannot know when a mutable
32
33
persistent-dictionary entry is modified. By default modified objects are
@@ -40,6 +41,10 @@ lots of shared sub-objects. The keys are ordinary strings.
40
41
determine which accessed entries are mutable, nor which ones were actually
41
42
mutated).
42
43
44
+ .. versionchanged :: 3.10
45
+ :data: `pickle.DEFAULT_PROTOCOL ` is now used as the default pickle
46
+ protocol.
47
+
43
48
.. note ::
44
49
45
50
Do not rely on the shelf being closed automatically; always call
@@ -108,9 +113,10 @@ Restrictions
108
113
A subclass of :class: `collections.abc.MutableMapping ` which stores pickled
109
114
values in the *dict * object.
110
115
111
- By default, version 3 pickles are used to serialize values. The version of the
112
- pickle protocol can be specified with the *protocol * parameter. See the
113
- :mod: `pickle ` documentation for a discussion of the pickle protocols.
116
+ By default, pickles created with :data: `pickle.DEFAULT_PROTOCOL ` are used
117
+ to serialize values. The version of the pickle protocol can be specified
118
+ with the *protocol * parameter. See the :mod: `pickle ` documentation for a
119
+ discussion of the pickle protocols.
114
120
115
121
If the *writeback * parameter is ``True ``, the object will hold a cache of all
116
122
entries accessed and write them back to the *dict * at sync and close times.
@@ -130,6 +136,10 @@ Restrictions
130
136
.. versionchanged :: 3.4
131
137
Added context manager support.
132
138
139
+ .. versionchanged :: 3.10
140
+ :data: `pickle.DEFAULT_PROTOCOL ` is now used as the default pickle
141
+ protocol.
142
+
133
143
134
144
.. class :: BsdDbShelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
135
145
0 commit comments