Use 'key in dict' instead of 'dict.has_key(key)'
Fix some 'open's not using 'with'
Change None tests to use identity rather than equality
Remove some mutable default arguments
Use endswith instead of slicing