does close() imply flush() in Python?

Adam Matan picture Adam Matan · Mar 15, 2010 · Viewed 14.8k times · Source

In Python, and in general - does a close() operation on a file object imply a flush() operation?

Answer

Martin Wickman picture Martin Wickman · Mar 15, 2010

Yes. It uses the underlying close() function which does that for you (source).