Skip to content

Commit 7b94f47

Browse files
[3.11] Docs: reword sentences about dbm submodule traits (pythonGH-114609) (python#115463)
Don't repeatedly say that keys and values are coerced into bytes. (cherry picked from commit 81e140d) Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent c4e8ffb commit 7b94f47

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Doc/library/dbm.rst

+6-14
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU dbm)`
160160
library, similar to the :mod:`dbm.ndbm` module, but with additional
161161
functionality like crash tolerance.
162162

163-
:class:`!gdbm` objects behave similar to :term:`mappings <mapping>`,
164-
except that keys and values are always converted to :class:`bytes` before storing,
165-
and the :meth:`!items` and :meth:`!values` methods are not supported.
166-
167163
.. note:: |incompat_note|
168164

169165
.. exception:: error
@@ -211,8 +207,9 @@ and the :meth:`!items` and :meth:`!values` methods are not supported.
211207

212208
A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` supports.
213209

214-
In addition to the dictionary-like methods, :class:`gdbm` objects have the
215-
following methods and attributes:
210+
:class:`!gdbm` objects behave similar to :term:`mappings <mapping>`,
211+
but :meth:`!items` and :meth:`!values` methods are not supported.
212+
The following methods are also provided:
216213

217214
.. method:: gdbm.firstkey()
218215

@@ -263,10 +260,6 @@ and the :meth:`!items` and :meth:`!values` methods are not supported.
263260

264261
The :mod:`dbm.ndbm` module provides an interface to the
265262
:abbr:`NDBM (New Database Manager)` library.
266-
:class:`!ndbm` objects behave similar to :term:`mappings <mapping>`,
267-
except that keys and values are always stored as :class:`bytes`,
268-
and the :meth:`!items` and :meth:`!values` methods are not supported.
269-
270263
This module can be used with the "classic" NDBM interface or the
271264
:abbr:`GDBM (GNU dbm)` compatibility interface.
272265

@@ -308,8 +301,9 @@ This module can be used with the "classic" NDBM interface or the
308301
:param int mode:
309302
|mode_param_doc|
310303

311-
In addition to the dictionary-like methods, :class:`!ndbm` objects
312-
provide the following method:
304+
:class:`!ndbm` objects behave similar to :term:`mappings <mapping>`,
305+
but :meth:`!items` and :meth:`!values` methods are not supported.
306+
The following methods are also provided:
313307

314308
.. versionchanged:: 3.11
315309
Accepts :term:`path-like object` for filename.
@@ -342,8 +336,6 @@ The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like
342336
interface which is written entirely in Python.
343337
Unlike other :mod:`dbm` backends, such as :mod:`dbm.gnu`, no
344338
external library is required.
345-
As with other :mod:`dbm` backends,
346-
the keys and values are always stored as :class:`bytes`.
347339

348340
The :mod:`!dbm.dumb` module defines the following:
349341

0 commit comments

Comments
 (0)