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
793d4b49
Commit
793d4b49
authored
Jun 01, 2002
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF 563203. Replaced 'has_key()' with 'in'.
parent
54f02225
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Lib/dumbdbm.py
Lib/dumbdbm.py
+3
-3
No files found.
Lib/dumbdbm.py
View file @
793d4b49
...
...
@@ -108,7 +108,7 @@ class _Database:
def
__setitem__
(
self
,
key
,
val
):
if
not
type
(
key
)
==
type
(
''
)
==
type
(
val
):
raise
TypeError
,
"keys and values must be strings"
if
not
self
.
_index
.
has_key
(
key
)
:
if
not
key
in
self
.
_index
:
(
pos
,
siz
)
=
self
.
_addval
(
val
)
self
.
_addkey
(
key
,
(
pos
,
siz
))
else
:
...
...
@@ -130,10 +130,10 @@ class _Database:
return
self
.
_index
.
keys
()
def
has_key
(
self
,
key
):
return
self
.
_index
.
has_key
(
key
)
return
key
in
self
.
_index
def
__contains__
(
self
,
key
):
return
self
.
_index
.
has_key
(
key
)
return
key
in
self
.
_index
def
iterkeys
(
self
):
return
self
.
_index
.
iterkeys
()
...
...
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