Message 104857 - Python tracker (original) (raw)
Well, a context manager sounds overkill since we just want to write some content in a file (and nothing else during that context).
Using a context manager, though, is the recommended idiom to write files. I think there's a value in remaining consistent. We don't want to end up like PHP which has dozens of different idioms of doing similar things.