@@ -101,7 +101,7 @@ Restrictions
101101 implementation used.
102102
103103
104- .. class :: Shelf(dict, protocol=None, writeback=False)
104+ .. class :: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8' )
105105
106106 A subclass of :class: `collections.MutableMapping ` which stores pickled values
107107 in the *dict * object.
@@ -115,8 +115,15 @@ Restrictions
115115 This allows natural operations on mutable entries, but can consume much more
116116 memory and make sync and close take a long time.
117117
118+ The *keyencoding * parameter is the encoding used to encode keys before they
119+ are used with the underlying dict.
118120
119- .. class :: BsdDbShelf(dict, protocol=None, writeback=False)
121+ .. versionadded :: 3.2
122+ The *keyencoding * parameter; previously, keys were always encoded in
123+ UTF-8.
124+
125+
126+ .. class :: BsdDbShelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
120127
121128 A subclass of :class: `Shelf ` which exposes :meth: `first `, :meth: `!next `,
122129 :meth: `previous `, :meth: `last ` and :meth: `set_location ` which are available
@@ -125,8 +132,8 @@ Restrictions
125132 modules. The *dict * object passed to the constructor must support those
126133 methods. This is generally accomplished by calling one of
127134 :func: `bsddb.hashopen `, :func: `bsddb.btopen ` or :func: `bsddb.rnopen `. The
128- optional *protocol * and *writeback * parameters have the same interpretation
129- as for the :class: `Shelf ` class.
135+ optional *protocol *, * writeback *, and *keyencoding * parameters have the same
136+ interpretation as for the :class: `Shelf ` class.
130137
131138
132139.. class :: DbfilenameShelf(filename, flag='c', protocol=None, writeback=False)
0 commit comments