| The optional *mode* argument is the Unix mode of the file, used only when the |
| database has to be created. It defaults to octal ``0666`` (and will be modified |
| by the prevailing umask). |
| |
| |
| .. exception:: error |
| |
| A tuple containing the exceptions that can be raised by each of the supported |
t | modules, with a unique exception :exc:`anydbm.error` as the first item --- the |
t | modules, with a unique exception also named :exc:`anydbm.error` as the first |
| latter is used when :exc:`anydbm.error` is raised. |
| item --- the latter is used when :exc:`anydbm.error` is raised. |
| |
| The object returned by :func:`open` supports most of the same functionality as |
| dictionaries; keys and their corresponding values can be stored, retrieved, and |
| deleted, and the :meth:`has_key` and :meth:`keys` methods are available. Keys |
| and values must always be strings. |
| |
| The following example records some hostnames and a corresponding title, and |
| then prints out the contents of the database:: |