summaryrefslogtreecommitdiffstats
path: root/Lib/anydbm.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
commitcfa8483051554b0e300b4b0c4a84c65bd2819cd3 (patch)
treebee40781a6ac3047269fe8ac195008de4ec181fb /Lib/anydbm.py
parent941592aa19c3419a04a253c8897b672fe88cbae3 (diff)
parent2a53d33dc61e782c091ea8319ca0098ed2ff36a8 (diff)
downloadcpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.zip
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.gz
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.bz2
Branch merge
Diffstat (limited to 'Lib/anydbm.py')
-rw-r--r--Lib/anydbm.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/Lib/anydbm.py b/Lib/anydbm.py
index 8b01ef3..ba7e905 100644
--- a/Lib/anydbm.py
+++ b/Lib/anydbm.py
@@ -29,17 +29,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.
-
"""
class error(Exception):
@@ -63,7 +54,18 @@ if not _defaultmod:
error = tuple(_errors)
-def open(file, flag = 'r', mode = 0666):
+def open(file, flag='r', mode=0666):
+ """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.
+ """
+
# guess the type of an existing database
from whichdb import whichdb
result=whichdb(file)