Python's built-in open function returns a "file-like object". These file objects can be obtained in other ways as well, and may not actually represent files.
I haven't been able to find what I want to know about these.
https://docs.python.org/3/glossary.html#term-file-object states that all file objects all have 1 thing in common: they expose "a file-oriented API". But I can't find any documentation about this api.
A file object's write method seems to return an integer, but what does it represent? Is the return value guaranteed to be an integer? What methods and properties are file objects guaranteed to have?
writeto verify. But I don't know of any documentation specifically for generic file-like objects.writein the anywhere in the Python/C API Reference Manual. However, after your comment, I decided to try again, and looked through the The Python Tutorial this time. I was able to find a little documentation aboutwriteand what it returns in The Python Tutorial, here: docs.python.org/3/tutorial/… . (It says it "returns the number of characters written".)