]> granicus.if.org Git - python/commit
Don't write "if self.dict: self.dict.close()"; just write
authorGuido van Rossum <guido@python.org>
Thu, 26 Mar 1998 22:12:22 +0000 (22:12 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 26 Mar 1998 22:12:22 +0000 (22:12 +0000)
commit65e5399081e23d7b1efbf685096c65d0a0ab912b
tree01e6410fbc78bdbcdc684e004b032fc37d995813
parent3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9
Don't write "if self.dict: self.dict.close()"; just write
"self.dict.close()" and ignore the exception.  The "if self.dict:"
part would be calculated through len(self.dict.keys()), which is very
expensive for a large dictionary...
Lib/shelve.py