Closing parentheses should not have any whitespace before them.

Anti-pattern

with open('file.dat' ) as f:
    contents = f.read()

Best practice

with open('file.dat') as f:
    contents = f.read()