File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,13 @@ The :meth:`!keys` method returns a list instead of a view object.
99
99
The :meth: `!setdefault ` method requires two arguments.
100
100
101
101
Key and values are always stored as :class: `bytes `. This means that when
102
- strings are used they are implicitly converted to the default encoding before
103
- being stored.
102
+ strings are used they are implicitly converted to bytes before being stored.
103
+ The specific encoding used for this conversion is backend-dependent and may
104
+ vary between different dbm implementations and systems. The encoding choice
105
+ is determined by the underlying database implementation. For consistent
106
+ behavior across different backends and to maintain control over the encoding
107
+ process, it is strongly recommended to explicitly convert strings to bytes
108
+ using a specific encoding before storing them.
104
109
105
110
These objects also support being used in a :keyword: `with ` statement, which
106
111
will automatically close them when done.
You can’t perform that action at this time.
0 commit comments