Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ba2332

Browse files
committed
clean up some more bsddb scraps
1 parent c469d4c commit 6ba2332

4 files changed

Lines changed: 3 additions & 104 deletions

File tree

Doc/library/dbm.rst

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -87,93 +87,6 @@ then prints out the contents of the database::
8787
The individual submodules are described in the following sections.
8888

8989

90-
:mod:`dbm.bsd` --- DBM-style interface to the BSD database library
91-
------------------------------------------------------------------
92-
93-
.. module:: dbm.bsd
94-
:synopsis: DBM-style interface to the BSD database library.
95-
.. sectionauthor:: Fred L. Drake, Jr. <[email protected]>
96-
97-
.. index:: module: bsddb
98-
99-
The :mod:`dbm.bsd` module provides a function to open databases using the BSD
100-
``db`` library. This module mirrors the interface of the other Python database
101-
modules that provide access to DBM-style databases. The :mod:`bsddb` module is
102-
required to use :mod:`dbm.bsd`.
103-
104-
.. exception:: error
105-
106-
Exception raised on database errors other than :exc:`KeyError`. It is a synonym
107-
for :exc:`bsddb.error`.
108-
109-
110-
.. function:: open(path[, flag[, mode]])
111-
112-
Open a ``db`` database and return the database object. The *path* argument is
113-
the name of the database file.
114-
115-
The *flag* argument can be:
116-
117-
+---------+-------------------------------------------+
118-
| Value | Meaning |
119-
+=========+===========================================+
120-
| ``'r'`` | Open existing database for reading only |
121-
| | (default) |
122-
+---------+-------------------------------------------+
123-
| ``'w'`` | Open existing database for reading and |
124-
| | writing |
125-
+---------+-------------------------------------------+
126-
| ``'c'`` | Open database for reading and writing, |
127-
| | creating it if it doesn't exist |
128-
+---------+-------------------------------------------+
129-
| ``'n'`` | Always create a new, empty database, open |
130-
| | for reading and writing |
131-
+---------+-------------------------------------------+
132-
133-
For platforms on which the BSD ``db`` library supports locking, an ``'l'``
134-
can be appended to indicate that locking should be used.
135-
136-
The optional *mode* parameter is used to indicate the Unix permission bits that
137-
should be set if a new database must be created; this will be masked by the
138-
current umask value for the process.
139-
140-
The database objects returned by :func:`open` provide the methods common to all
141-
the DBM-style databases and mapping objects. The following methods are
142-
available in addition to the standard methods:
143-
144-
.. method:: dbhash.first()
145-
146-
It's possible to loop over every key/value pair in the database using this
147-
method and the :meth:`next` method. The traversal is ordered by the databases
148-
internal hash values, and won't be sorted by the key values. This method
149-
returns the starting key.
150-
151-
.. method:: dbhash.last()
152-
153-
Return the last key/value pair in a database traversal. This may be used to
154-
begin a reverse-order traversal; see :meth:`previous`.
155-
156-
.. method:: dbhash.next()
157-
158-
Returns the key next key/value pair in a database traversal. The following code
159-
prints every key in the database ``db``, without having to create a list in
160-
memory that contains them all::
161-
162-
print(db.first())
163-
for i in range(1, len(db)):
164-
print(db.next())
165-
166-
.. method:: dbhash.previous()
167-
168-
Returns the previous key/value pair in a forward-traversal of the database. In
169-
conjunction with :meth:`last`, this may be used to implement a reverse-order
170-
traversal.
171-
172-
.. method:: dbhash.sync()
173-
174-
This method forces any unwritten data to be written to the disk.
175-
176-
17790
:mod:`dbm.gnu` --- GNU's reinterpretation of dbm
17891
------------------------------------------------
17992

Doc/library/persistence.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ The modules described in this chapter support storing Python data in a
99
persistent form on disk. The :mod:`pickle` and :mod:`marshal` modules can turn
1010
many Python data types into a stream of bytes and then recreate the objects from
1111
the bytes. The various DBM-related modules support a family of hash-based file
12-
formats that store a mapping of strings to other strings. The :mod:`bsddb`
13-
module also provides such disk-based string-to-string mappings based on hashing,
14-
and also supports B-Tree and record-based formats.
12+
formats that store a mapping of strings to other strings.
1513

1614
The list of modules described in this chapter is:
1715

@@ -23,5 +21,4 @@ The list of modules described in this chapter is:
2321
shelve.rst
2422
marshal.rst
2523
dbm.rst
26-
bsddb.rst
2724
sqlite3.rst

Lib/dbm/bsd.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

Misc/NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ C API
7373
Library
7474
-------
7575

76+
- The bsddb module (and therefore the dbm.bsd module) has been removed.
77+
7678
- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
7779
to the urlparse one. Added a DeprecationWarning in the old module, it
7880
will be deprecated in the future.
7981

80-
- The bsddb module has been removed.
81-
8282
- Issue #3719: platform.architecture() fails if there are spaces in the
8383
path to the Python binary.
8484

0 commit comments

Comments
 (0)