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...
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...

sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator