summaryrefslogtreecommitdiffstats
path: root/Doc/library/dbm.rst
diff options
context:
space:
mode:
authorHenry-Joseph Audéoud <h.audeoud@gmail.com>2021-09-10 12:26:16 (GMT)
committerGitHub <noreply@github.com>2021-09-10 12:26:16 (GMT)
commit707137b8637feef37b2e06a851fdca9d1b945861 (patch)
treeeedd9bec5c0b98b244438e120ee12d8143906c19 /Doc/library/dbm.rst
parent62fa613f6a6e872723505ee9d56242c31a654a9d (diff)
downloadcpython-707137b8637feef37b2e06a851fdca9d1b945861.zip
cpython-707137b8637feef37b2e06a851fdca9d1b945861.tar.gz
cpython-707137b8637feef37b2e06a851fdca9d1b945861.tar.bz2
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
Diffstat (limited to 'Doc/library/dbm.rst')
-rw-r--r--Doc/library/dbm.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst
index ff01ae9..2be4993 100644
--- a/Doc/library/dbm.rst
+++ b/Doc/library/dbm.rst
@@ -33,6 +33,8 @@ the Oracle Berkeley DB.
file's format can't be guessed; or a string containing the required module
name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``.
+.. versionchanged:: 3.11
+ Accepts :term:`path-like object` for filename.
.. function:: open(file, flag='r', mode=0o666)
@@ -77,6 +79,9 @@ available, as well as :meth:`get` and :meth:`setdefault`.
Deleting a key from a read-only database raises database module specific error
instead of :exc:`KeyError`.
+.. versionchanged:: 3.11
+ Accepts :term:`path-like object` for file.
+
Key and values are always stored as bytes. This means that when
strings are used they are implicitly converted to the default encoding before
being stored.
@@ -202,6 +207,9 @@ supported.
In addition to the dictionary-like methods, ``gdbm`` objects have the
following methods:
+ .. versionchanged:: 3.11
+ Accepts :term:`path-like object` for filename.
+
.. method:: gdbm.firstkey()
It's possible to loop over every key in the database using this method and the
@@ -298,6 +306,9 @@ to locate the appropriate header file to simplify building this module.
In addition to the dictionary-like methods, ``ndbm`` objects
provide the following method:
+ .. versionchanged:: 3.11
+ Accepts :term:`path-like object` for filename.
+
.. method:: ndbm.close()
Close the ``ndbm`` database.
@@ -379,6 +390,9 @@ The module defines the following:
flags ``'r'`` and ``'w'`` no longer creates a database if it does not
exist.
+ .. versionchanged:: 3.11
+ Accepts :term:`path-like object` for filename.
+
In addition to the methods provided by the
:class:`collections.abc.MutableMapping` class, :class:`dumbdbm` objects
provide the following methods: