Skip to content

Commit 797760e

Browse files
Docs: reword the dbm.dumb introduction
Also: - consistently name the database "dumbdbm" - fix broken dumbdbm class refs - improve accuracy of the dbm.dump.open() spec
1 parent c63c614 commit 797760e

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Doc/library/dbm.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -344,26 +344,28 @@ to locate the appropriate header file to simplify building this module.
344344

345345
--------------
346346

347-
The :mod:`dbm.dumb` module provides a persistent dictionary-like interface which
348-
is written entirely in Python. Unlike other modules such as :mod:`dbm.gnu` no
349-
external library is required. As with other persistent mappings, the keys and
350-
values are always stored as bytes.
351-
352-
The module defines the following:
347+
The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like interface which
348+
is written entirely in Python.
349+
Unlike other :mod:`dbm` backends, such as :mod:`dbm.gnu` no,
350+
external library is required.
351+
As with other persistent :term:`mappings <mapping>`,
352+
the keys and values are always stored as :class:`bytes`.
353353

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

355356
.. exception:: error
356357

357358
Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:`KeyError` is
358359
raised for general mapping errors like specifying an incorrect key.
359360

360361

361-
.. function:: open(filename[, flag[, mode]])
362+
.. function:: open(filename, flag="c", mode=0o666)
362363

363-
Open a ``dumbdbm`` database and return a dumbdbm object. The *filename* argument is
364-
the basename of the database file (without any specific extensions). When a
365-
dumbdbm database is created, files with :file:`.dat` and :file:`.dir` extensions
366-
are created.
364+
Open a "dumbdbm" database and return a :class:`!dumbdbm` object.
365+
The *filename* argument is the basename of the database file
366+
(without any specific extensions).
367+
When a "dumbdbm" database is created,
368+
files with :file:`.dat` and :file:`.dir` extensions are created.
367369

368370
The optional *flag* argument can be:
369371

@@ -385,7 +387,7 @@ The module defines the following:
385387
Python's AST compiler.
386388

387389
.. versionchanged:: 3.5
388-
:func:`.open` always creates a new database when the flag has the value
390+
:func:`open` always creates a new database when the flag has the value
389391
``'n'``.
390392

391393
.. versionchanged:: 3.8
@@ -397,7 +399,7 @@ The module defines the following:
397399
Accepts :term:`path-like object` for filename.
398400

399401
In addition to the methods provided by the
400-
:class:`collections.abc.MutableMapping` class, :class:`dumbdbm` objects
402+
:class:`collections.abc.MutableMapping` class, :class:`!dumbdbm` objects
401403
provide the following methods:
402404

403405
.. method:: dumbdbm.sync()
@@ -407,5 +409,5 @@ The module defines the following:
407409

408410
.. method:: dumbdbm.close()
409411

410-
Close the ``dumbdbm`` database.
412+
Close the "dumbdbm" database.
411413

0 commit comments

Comments
 (0)