Message116188
| Author |
pv |
| Recipients |
pv |
| Date |
2010年09月12日.13:23:44 |
| SpamBayes Score |
0.00010164025 |
| Marked as misclassified |
No |
| Message-id |
<1284297827.04.0.573858766917.issue9838@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The C-API exposed by the `io` module on Python 3.1/3.2 is very limited, and makes interfacing with Python file objects in extension modules difficult.
In more detail:
1) Because the Python layer has buffering etc., the file handle returned by `PyObject_AsFileDescriptor` is not usable as-is. It requires flush and seek before use, every time there is a chance that the file object has been accessed on the Python side.
2) There are no C-API functions such as the minimal set of `PyFile_Write(buf, length)`, `PyFile_Read(buf, length)`, `PyFile_Seek(pos, whence)`, `PyFile_Tell()`.
Instead, every call must go through PyObject_CallMethod, and the file objects only handle `PyBytes` and `PyByteArray` which are cumbersome and inefficient to use in extension modules. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年09月12日 13:23:47 | pv | set | recipients:
+ pv |
| 2010年09月12日 13:23:47 | pv | set | messageid: <1284297827.04.0.573858766917.issue9838@psf.upfronthosting.co.za> |
| 2010年09月12日 13:23:45 | pv | link | issue9838 messages |
| 2010年09月12日 13:23:44 | pv | create |
|