I want to create a file-like object to be passed to another module. I don't know if that other module will be calling read() or readline() or both. If I were to subclass say io.IOBase and just implement read() would that be sufficient, even if the client is calling readline()?
Bonus question: if my class will be opened in text mode, what's the minimum I can implement to let the superclass handle the unicode decoding?
(This will be an input-only class.)
Meta: I know I could just write all the methods and see what actually gets called, but I'd like to be a bit "future proof" and write to the actual specs, instead of trying things to see if they work, and then having them break in the future someday.