Skip to content

Commit ed5015d

Browse files
Document the clear() methods the same way as get() and setdefault() methods.
1 parent ba9dfb1 commit ed5015d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Doc/library/dbm.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ The object returned by :func:`~dbm.open` supports the basic
9494
functionality of mutable :term:`mappings <mapping>`;
9595
keys and their corresponding values can be stored, retrieved, and
9696
deleted, and iteration, the :keyword:`in` operator and methods :meth:`!keys`,
97-
:meth:`!get` and :meth:`!setdefault` are available.
98-
The :meth:`!keys` method usually returns a list instead of a view object.
97+
:meth:`!get`, :meth:`!setdefault` and :meth:`!clear` are available.
98+
The :meth:`!keys` method returns a list instead of a view object.
9999
The :meth:`!setdefault` method requires two arguments.
100100

101101
Key and values are always stored as :class:`bytes`. This means that when
@@ -298,13 +298,13 @@ functionality like crash tolerance.
298298
the :meth:`!setdefault` method requires two arguments.
299299
It also supports a "closing" context manager via the :keyword:`with` keyword.
300300

301-
The following methods are also provided:
302-
303-
.. method:: gdbm.clear()
301+
.. versionchanged:: 3.2
302+
Added the :meth:`!get` and :meth:`!setdefault` methods.
304303

305-
Remove all items from the GDBM database.
304+
.. versionchanged:: 3.13
305+
Added the :meth:`!clear` method.
306306

307-
.. versionadded:: 3.13
307+
The following methods are also provided:
308308

309309
.. method:: gdbm.close()
310310

@@ -415,13 +415,13 @@ This module can be used with the "classic" NDBM interface or the
415415
the :meth:`!setdefault` method requires two arguments.
416416
It also supports a "closing" context manager via the :keyword:`with` keyword.
417417

418-
The following methods are also provided:
419-
420-
.. method:: ndbm.clear()
418+
.. versionchanged:: 3.2
419+
Added the :meth:`!get` and :meth:`!setdefault` methods.
421420

422-
Remove all items from the NDBM database.
421+
.. versionchanged:: 3.13
422+
Added the :meth:`!clear` method.
423423

424-
.. versionadded:: 3.13
424+
The following method is also provided:
425425

426426
.. method:: ndbm.close()
427427

0 commit comments

Comments
 (0)