Skip to content

Docs: reword sentences about dbm submodule traits #114609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 14, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions Doc/library/dbm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,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
Expand Down Expand Up @@ -207,8 +203,9 @@ and the :meth:`!items` and :meth:`!values` methods are not supported.
The optional *mode* argument is the Unix mode of the file, used only when the
database has to be created. It defaults to octal ``0o666``.

In addition to the dictionary-like methods, :class:`gdbm` objects have the
following methods:
: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:

.. versionchanged:: 3.11
Accepts :term:`path-like object` for filename.
Expand Down Expand Up @@ -268,10 +265,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.

Expand Down Expand Up @@ -315,8 +308,9 @@ This module can be used with the "classic" NDBM interface or the
database has to be created. It defaults to octal ``0o666`` (and will be
modified by the prevailing umask).

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.
Expand Down Expand Up @@ -355,8 +349,8 @@ 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 module defines the following:

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

Expand Down