rest25/library/gdbm.rst => rest262/library/gdbm.rst
n1- 
2:mod:`gdbm` --- GNU's reinterpretation of dbm
3=============================================
4
5.. module:: gdbm
6   :platform: Unix
7   :synopsis: GNU's reinterpretation of dbm.
n7+ 
8+.. note::
9+   The :mod:`gdbm` module has been renamed to :mod:`dbm.gnu` in Python 3.0.  The
10+   :term:`2to3` tool will automatically adapt imports when converting your
11+   sources to 3.0.
8
9
10.. index:: module: dbm
11
12This module is quite similar to the :mod:`dbm` module, but uses ``gdbm`` instead
13to provide some additional functionality.  Please note that the file formats
14created by ``gdbm`` and ``dbm`` are incompatible.
15
27   raised for general mapping errors like specifying an incorrect key.
28
29
30.. function:: open(filename, [flag, [mode]])
31
32   Open a ``gdbm`` database and return a ``gdbm`` object.  The *filename* argument
33   is the name of the database file.
34
n35-   The optional *flag* argument can be ``'r'`` (to open an existing database for
n39+   The optional *flag* argument can be:
36-   reading only --- default), ``'w'`` (to open an existing database for reading and
37-   writing), ``'c'`` (which creates the database if it doesn't exist), or ``'n'``
38-   (which always creates a new empty database).
39
n40-   The following additional characters may be appended to the flag to control how
n41+   +---------+-------------------------------------------+
41-   the database is opened:
42+   | Value   | Meaning                                   |
43+   +=========+===========================================+
44+   | ``'r'`` | Open existing database for reading only   |
45+   |         | (default)                                 |
46+   +---------+-------------------------------------------+
47+   | ``'w'`` | Open existing database for reading and    |
48+   |         | writing                                   |
49+   +---------+-------------------------------------------+
50+   | ``'c'`` | Open database for reading and writing,    |
51+   |         | creating it if it doesn't exist           |
52+   +---------+-------------------------------------------+
53+   | ``'n'`` | Always create a new, empty database, open |
54+   |         | for reading and writing                   |
55+   +---------+-------------------------------------------+
42
n43-* ``'f'`` --- Open the database in fast mode.  Writes to the database will not
n57+   The following additional characters may be appended to the flag to control
44-     be synchronized.
58+   how the database is opened:
45
n60+   +---------+--------------------------------------------+
61+   | Value   | Meaning                                    |
62+   +=========+============================================+
63+   | ``'f'`` | Open the database in fast mode.  Writes    |
64+   |         | to the database will not be synchronized.  |
65+   +---------+--------------------------------------------+
46-* ``'s'`` --- Synchronized mode. This will cause changes to the database will be
66+   | ``'s'`` | Synchronized mode. This will cause changes |
47-     immediately written to the file.
67+   |         | to the database to be immediately written  |
48- 
68+   |         | to the file.                               |
49-* ``'u'`` --- Do not lock database.
69+   +---------+--------------------------------------------+
70+   | ``'u'`` | Do not lock database.                      |
71+   +---------+--------------------------------------------+
50
51   Not all flags are valid for all versions of ``gdbm``.  The module constant
t52-   ``open_flags`` is a string of supported flag characters.  The exception
t74+   :const:`open_flags` is a string of supported flag characters.  The exception
53   :exc:`error` is raised if an invalid flag is specified.
54
55   The optional *mode* argument is the Unix mode of the file, used only when the
56   database has to be created.  It defaults to octal ``0666``.
57
58In addition to the dictionary-like methods, ``gdbm`` objects have the following
59methods:
60
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op