Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
428b44e7
Commit
428b44e7
authored
Apr 20, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docstring to dbm.open
parent
c8dd7871
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
Lib/dbm/__init__.py
Lib/dbm/__init__.py
+12
-10
No files found.
Lib/dbm/__init__.py
View file @
428b44e7
...
...
@@ -24,16 +24,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, a
nd a
dd 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'
,
'error'
]
...
...
@@ -54,7 +46,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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment