Jérôme Kieffer, 28.02.2014 21:36:
It's a bit more complex than that. In both Py2 and Py3, you can get at the
file descriptor (an integer value). However, you most like don't want to
use that because it doesn't take Python level buffering into account.
Even in Py2, you have to double check that reading from the underlying C
FILE* starts at exactly the same byte as reading from the file object
(seeking, buffering, ...). And this really only works for files opened
directly from the file system, not for arbitrary file-like objects
(BytesIO, urlopen, ...).
So, even in Py2, the value of this C-API is fairly limited, which is why it
was so easily dropped in Py3.
Stefan