@@ -9,32 +9,8 @@ File Objects
99
1010Python's built-in file objects are implemented entirely on the :ctype: `FILE\* `
1111support from the C standard library. This is an implementation detail and may
12- change in future releases of Python.
13-
14-
15- .. ctype :: PyFileObject
16-
17- This subtype of :ctype: `PyObject ` represents a Python file object.
18-
19-
20- .. cvar :: PyTypeObject PyFile_Type
21-
22- .. index :: single: FileType (in module types)
23-
24- This instance of :ctype: `PyTypeObject ` represents the Python file type. This is
25- exposed to Python programs as ``file `` and ``types.FileType ``.
26-
27-
28- .. cfunction :: int PyFile_Check(PyObject *p)
29-
30- Return true if its argument is a :ctype: `PyFileObject ` or a subtype of
31- :ctype: `PyFileObject `.
32-
33-
34- .. cfunction :: int PyFile_CheckExact(PyObject *p)
35-
36- Return true if its argument is a :ctype: `PyFileObject `, but not a subtype of
37- :ctype: `PyFileObject `.
12+ change in future releases of Python. The ``PyFile_ `` APIs are a wrapper over
13+ the :mod: `io ` module.
3814
3915
4016.. cfunction :: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *newline, int closefd)
@@ -74,39 +50,6 @@ change in future releases of Python.
7450 raised if the end of the file is reached immediately.
7551
7652
77- .. cfunction :: PyObject* PyFile_Name(PyObject *p)
78-
79- Return the name of the file specified by *p * as a string object.
80-
81-
82- .. cfunction :: void PyFile_SetBufSize(PyFileObject *p, int n)
83-
84- .. index :: single: setvbuf()
85-
86- Available on systems with :cfunc: `setvbuf ` only. This should only be called
87- immediately after file object creation.
88-
89-
90- .. cfunction :: int PyFile_SetEncoding(PyFileObject *p, const char *enc)
91-
92- Set the file's encoding for Unicode output to *enc *. Return 1 on success and 0
93- on failure.
94-
95-
96- .. cfunction :: int PyFile_SoftSpace(PyObject *p, int newflag)
97-
98- .. index :: single: softspace (file attribute)
99-
100- This function exists for internal use by the interpreter. Set the
101- :attr: `softspace ` attribute of *p * to *newflag * and return the previous value.
102- *p * does not have to be a file object for this function to work properly; any
103- object is supported (thought its only interesting if the :attr: `softspace `
104- attribute can be set). This function clears any errors, and will return ``0 ``
105- as the previous value if the attribute either does not exist or if there were
106- errors in retrieving it. There is no way to detect errors from this function,
107- but doing so should not be needed.
108-
109-
11053.. cfunction :: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
11154
11255 .. index :: single: Py_PRINT_RAW
0 commit comments