summaryrefslogtreecommitdiffstats
path: root/Lib/bdb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-18 22:13:04 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-18 22:13:04 (GMT)
commite2b70bcf7401477936fba99a8bf4a1f759ecc8a3 (patch)
tree4c9b65b7fd8c26a3d2f1b64ecd6b4c72a756b4b2 /Lib/bdb.py
parentd2dbecb4ae9177e2e87adcb047147c6bcbf28cc1 (diff)
downloadcpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.zip
cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.gz
cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.bz2
Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint... The C API still has PyDict_HasKey() and _HasKeyString(); not sure if I want to change those just yet.
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 0c56b63..1e81c44 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -133,8 +133,7 @@ class Bdb:
raise NotImplementedError, "subclass of bdb must implement do_clear()"
def break_anywhere(self, frame):
- return self.breaks.has_key(
- self.canonic(frame.f_code.co_filename))
+ return self.canonic(frame.f_code.co_filename) in self.breaks
# Derived classes should override the user_* methods
# to gain control.
@@ -245,7 +244,7 @@ class Bdb:
# pair, then remove the breaks entry
for bp in Breakpoint.bplist[filename, lineno][:]:
bp.deleteMe()
- if not Breakpoint.bplist.has_key((filename, lineno)):
+ if (filename, lineno) not in Breakpoint.bplist:
self.breaks[filename].remove(lineno)
if not self.breaks[filename]:
del self.breaks[filename]
@@ -453,7 +452,7 @@ class Breakpoint:
Breakpoint.next = Breakpoint.next + 1
# Build the two lists
self.bpbynumber.append(self)
- if self.bplist.has_key((file, line)):
+ if (file, line) in self.bplist:
self.bplist[file, line].append(self)
else:
self.bplist[file, line] = [self]