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
a7cc69e0
Commit
a7cc69e0
authored
May 03, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for .__contains__(), .__iter__(), .iterkeys().
parent
bedebbdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Lib/dumbdbm.py
Lib/dumbdbm.py
+8
-1
No files found.
Lib/dumbdbm.py
View file @
a7cc69e0
...
...
@@ -135,6 +135,13 @@ class _Database:
def
has_key
(
self
,
key
):
return
self
.
_index
.
has_key
(
key
)
def
__contains__
(
self
,
key
):
return
self
.
_index
.
has_key
(
key
)
def
iterkeys
(
self
):
return
self
.
_index
.
iterkeys
()
__iter__
=
iterkeys
def
__len__
(
self
):
return
len
(
self
.
_index
)
...
...
@@ -143,6 +150,6 @@ class _Database:
self
.
_datfile
=
self
.
_dirfile
=
self
.
_bakfile
=
None
def
open
(
file
,
flag
=
None
,
mode
=
None
):
def
open
(
file
,
flag
=
None
,
mode
=
None
):
# flag, mode arguments are currently ignored
return
_Database
(
file
)
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