summaryrefslogtreecommitdiffstats
path: root/Lib/dbm
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
commit37e6c54ba122703a0162dd44cf3eac78c46c8bdd (patch)
tree1453d6434ce4859948c382ae46cd12034e46fc8a /Lib/dbm
parent6f205ed37eb4b785b60081f957d515ca16b0db47 (diff)
parent5c1a0c969d82670ba7aac7647b9828f4df85c1bd (diff)
downloadcpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.zip
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.gz
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.bz2
Merge 3.1
Diffstat (limited to 'Lib/dbm')
-rw-r--r--Lib/dbm/__init__.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/Lib/dbm/__init__.py b/Lib/dbm/__init__.py
index 6e890f3..76a43c4 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -23,16 +23,8 @@ It has the following interface (key and data are strings):
list = d.keys() # return a list of all existing keys (slow!)
Future versions may change the order in which implementations are
-tested for existence, add interfaces to other dbm-like
+tested for existence, and add interfaces to other dbm-like
implementations.
-
-The open function has an optional second argument. This can be 'r',
-for read-only access, 'w', for read-write access of an existing
-database, 'c' for read-write access to a new or existing database, and
-'n' for read-write access to a new database. The default is 'r'.
-
-Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
-only if it doesn't exist; and 'n' always creates a new database.
"""
__all__ = ['open', 'whichdb', 'error']
@@ -53,7 +45,17 @@ _modules = {}
error = (error, IOError)
-def open(file, flag = 'r', mode = 0o666):
+def open(file, flag='r', mode=0o666):
+ """Open or create database at path given by *file*.
+
+ Optional argument *flag* can be 'r' (default) for read-only access, 'w'
+ for read-write access of an existing database, 'c' for read-write access
+ to a new or existing database, and 'n' for read-write access to a new
+ database.
+
+ Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
+ only if it doesn't exist; and 'n' always creates a new database.
+ """
global _defaultmod
if _defaultmod is None:
for name in _names: