Search code examples
pythonflush

does close() imply flush() in Python?


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


Solution

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