]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] Docs: reword sentences about dbm submodule traits (GH-114609) (#115463)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 14 Feb 2024 15:56:04 +0000 (16:56 +0100)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2024 15:56:04 +0000 (15:56 +0000)
Don't repeatedly say that keys and values are coerced into bytes.
(cherry picked from commit 81e140d10b77f0a41a5581412e3f3471cc77981f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Doc/library/dbm.rst

index 413d24461796a20669cdd0a8b66af4f1d3a603b5..babff3bc1fec64fb964dcb463d87410d399754e2 100644 (file)
@@ -160,10 +160,6 @@ The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU dbm)`
 library, similar to the :mod:`dbm.ndbm` module, but with additional
 functionality like crash tolerance.
 
-:class:`!gdbm` objects behave similar to :term:`mappings <mapping>`,
-except that keys and values are always converted to :class:`bytes` before storing,
-and the :meth:`!items` and :meth:`!values` methods are not supported.
-
 .. note:: |incompat_note|
 
 .. exception:: error
@@ -211,8 +207,9 @@ and the :meth:`!items` and :meth:`!values` methods are not supported.
 
       A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` supports.
 
-   In addition to the dictionary-like methods, :class:`gdbm` objects have the
-   following methods and attributes:
+   :class:`!gdbm` objects behave similar to :term:`mappings <mapping>`,
+   but :meth:`!items` and :meth:`!values` methods are not supported.
+   The following methods are also provided:
 
    .. method:: gdbm.firstkey()
 
@@ -263,10 +260,6 @@ and the :meth:`!items` and :meth:`!values` methods are not supported.
 
 The :mod:`dbm.ndbm` module provides an interface to the
 :abbr:`NDBM (New Database Manager)` library.
-:class:`!ndbm` objects behave similar to :term:`mappings <mapping>`,
-except that keys and values are always stored as :class:`bytes`,
-and the :meth:`!items` and :meth:`!values` methods are not supported.
-
 This module can be used with the "classic" NDBM interface or the
 :abbr:`GDBM (GNU dbm)` compatibility interface.
 
@@ -308,8 +301,9 @@ This module can be used with the "classic" NDBM interface or the
    :param int mode:
       |mode_param_doc|
 
-   In addition to the dictionary-like methods, :class:`!ndbm` objects
-   provide the following method:
+   :class:`!ndbm` objects behave similar to :term:`mappings <mapping>`,
+   but :meth:`!items` and :meth:`!values` methods are not supported.
+   The following methods are also provided:
 
    .. versionchanged:: 3.11
       Accepts :term:`path-like object` for filename.
@@ -342,8 +336,6 @@ The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like
 interface which is written entirely in Python.
 Unlike other :mod:`dbm` backends, such as :mod:`dbm.gnu`, no
 external library is required.
-As with other :mod:`dbm` backends,
-the keys and values are always stored as :class:`bytes`.
 
 The :mod:`!dbm.dumb` module defines the following: