Jan-06-2018, 07:14 AM
Often one only needs a small subset of these methods to create usable file-like objects, because functions that take a file parameter typically use a small part of the file API. For example a function that outputs XML data may take a file like object as paramater and use only its
write()
method. The function can be called with any object having a write method.