diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-03-29 15:24:25 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-03-29 15:24:25 (GMT) |
commit | 5b63acd31e0e40c1a9a9e9762905b0054ff37994 (patch) | |
tree | 763a6e10d4c0fa64797f5311491a3cbeb0f7e5d9 /Lib/bsddb | |
parent | 672fbf519568bc295aa64992dcbabe0eebccb5fc (diff) | |
download | cpython-5b63acd31e0e40c1a9a9e9762905b0054ff37994.zip cpython-5b63acd31e0e40c1a9a9e9762905b0054ff37994.tar.gz cpython-5b63acd31e0e40c1a9a9e9762905b0054ff37994.tar.bz2 |
#2503 make singletons compared with "is" not == or !=
Thanks to Wummel for the patch
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/dbshelve.py | 6 | ||||
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 4 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbtables.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py index f5f8b9a..96f604a 100644 --- a/Lib/bsddb/dbshelve.py +++ b/Lib/bsddb/dbshelve.py @@ -133,7 +133,7 @@ class DBShelf(DictMixin): def keys(self, txn=None): - if txn != None: + if txn is not None: return self.db.keys(txn) else: return self.db.keys() @@ -157,7 +157,7 @@ class DBShelf(DictMixin): def items(self, txn=None): - if txn != None: + if txn is not None: items = self.db.items(txn) else: items = self.db.items() @@ -168,7 +168,7 @@ class DBShelf(DictMixin): return newitems def values(self, txn=None): - if txn != None: + if txn is not None: values = self.db.values(txn) else: values = self.db.values() diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index de935f7..9b38d57 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -363,7 +363,7 @@ class BasicTestCase(unittest.TestCase): else: if set_raises_error: self.fail("expected exception") - if n != None: + if n is not None: self.fail("expected None: %r" % (n,)) rec = c.get_both('0404', self.makeData('0404')) @@ -377,7 +377,7 @@ class BasicTestCase(unittest.TestCase): else: if get_raises_error: self.fail("expected exception") - if n != None: + if n is not None: self.fail("expected None: %r" % (n,)) if self.d.get_type() == db.DB_BTREE: diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py index 46602ce..faddd11 100644 --- a/Lib/bsddb/test/test_dbtables.py +++ b/Lib/bsddb/test/test_dbtables.py @@ -323,7 +323,7 @@ class TableDBTestCase(unittest.TestCase): self.tdb.Insert(tabname, {'Type': 'Unknown', 'Access': '0'}) def set_type(type): - if type == None: + if type is None: return 'MP3' return type |