Open
Description
Feature or enhancement
The docs say:
Lines 91 to 98 in ac01e22
Lines 101 to 104 in ac01e22
However, implementation is a bit different (here's the important part of PyFile_WriteObject
which is used for both funcs):
Lines 119 to 131 in ac01e22
So, basically any object with one-argument write will work. In my tests I use io.StringIO
https://github.com/python/cpython/pull/111709/files#diff-b636fe6ac656d3029788c6c9431c0884dba5316e815ec64c1165597cdee065f8R86 which is clearly not a file.
Other similar docs have this note:
Lines 52 to 54 in ac01e22
So, I think here we can reference IOBase.write
(but it does not exist for some reason):