• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 PyDoc_STRVAR(_io__IOBase_tell__doc__,
6 "tell($self, /)\n"
7 "--\n"
8 "\n"
9 "Return current stream position.");
10 
11 #define _IO__IOBASE_TELL_METHODDEF    \
12     {"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__},
13 
14 static PyObject *
15 _io__IOBase_tell_impl(PyObject *self);
16 
17 static PyObject *
_io__IOBase_tell(PyObject * self,PyObject * Py_UNUSED (ignored))18 _io__IOBase_tell(PyObject *self, PyObject *Py_UNUSED(ignored))
19 {
20     return _io__IOBase_tell_impl(self);
21 }
22 
23 PyDoc_STRVAR(_io__IOBase_flush__doc__,
24 "flush($self, /)\n"
25 "--\n"
26 "\n"
27 "Flush write buffers, if applicable.\n"
28 "\n"
29 "This is not implemented for read-only and non-blocking streams.");
30 
31 #define _IO__IOBASE_FLUSH_METHODDEF    \
32     {"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__},
33 
34 static PyObject *
35 _io__IOBase_flush_impl(PyObject *self);
36 
37 static PyObject *
_io__IOBase_flush(PyObject * self,PyObject * Py_UNUSED (ignored))38 _io__IOBase_flush(PyObject *self, PyObject *Py_UNUSED(ignored))
39 {
40     return _io__IOBase_flush_impl(self);
41 }
42 
43 PyDoc_STRVAR(_io__IOBase_close__doc__,
44 "close($self, /)\n"
45 "--\n"
46 "\n"
47 "Flush and close the IO object.\n"
48 "\n"
49 "This method has no effect if the file is already closed.");
50 
51 #define _IO__IOBASE_CLOSE_METHODDEF    \
52     {"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__},
53 
54 static PyObject *
55 _io__IOBase_close_impl(PyObject *self);
56 
57 static PyObject *
_io__IOBase_close(PyObject * self,PyObject * Py_UNUSED (ignored))58 _io__IOBase_close(PyObject *self, PyObject *Py_UNUSED(ignored))
59 {
60     return _io__IOBase_close_impl(self);
61 }
62 
63 PyDoc_STRVAR(_io__IOBase_seekable__doc__,
64 "seekable($self, /)\n"
65 "--\n"
66 "\n"
67 "Return whether object supports random access.\n"
68 "\n"
69 "If False, seek(), tell() and truncate() will raise OSError.\n"
70 "This method may need to do a test seek().");
71 
72 #define _IO__IOBASE_SEEKABLE_METHODDEF    \
73     {"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__},
74 
75 static PyObject *
76 _io__IOBase_seekable_impl(PyObject *self);
77 
78 static PyObject *
_io__IOBase_seekable(PyObject * self,PyObject * Py_UNUSED (ignored))79 _io__IOBase_seekable(PyObject *self, PyObject *Py_UNUSED(ignored))
80 {
81     return _io__IOBase_seekable_impl(self);
82 }
83 
84 PyDoc_STRVAR(_io__IOBase_readable__doc__,
85 "readable($self, /)\n"
86 "--\n"
87 "\n"
88 "Return whether object was opened for reading.\n"
89 "\n"
90 "If False, read() will raise OSError.");
91 
92 #define _IO__IOBASE_READABLE_METHODDEF    \
93     {"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__},
94 
95 static PyObject *
96 _io__IOBase_readable_impl(PyObject *self);
97 
98 static PyObject *
_io__IOBase_readable(PyObject * self,PyObject * Py_UNUSED (ignored))99 _io__IOBase_readable(PyObject *self, PyObject *Py_UNUSED(ignored))
100 {
101     return _io__IOBase_readable_impl(self);
102 }
103 
104 PyDoc_STRVAR(_io__IOBase_writable__doc__,
105 "writable($self, /)\n"
106 "--\n"
107 "\n"
108 "Return whether object was opened for writing.\n"
109 "\n"
110 "If False, write() will raise OSError.");
111 
112 #define _IO__IOBASE_WRITABLE_METHODDEF    \
113     {"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__},
114 
115 static PyObject *
116 _io__IOBase_writable_impl(PyObject *self);
117 
118 static PyObject *
_io__IOBase_writable(PyObject * self,PyObject * Py_UNUSED (ignored))119 _io__IOBase_writable(PyObject *self, PyObject *Py_UNUSED(ignored))
120 {
121     return _io__IOBase_writable_impl(self);
122 }
123 
124 PyDoc_STRVAR(_io__IOBase_fileno__doc__,
125 "fileno($self, /)\n"
126 "--\n"
127 "\n"
128 "Returns underlying file descriptor if one exists.\n"
129 "\n"
130 "OSError is raised if the IO object does not use a file descriptor.");
131 
132 #define _IO__IOBASE_FILENO_METHODDEF    \
133     {"fileno", (PyCFunction)_io__IOBase_fileno, METH_NOARGS, _io__IOBase_fileno__doc__},
134 
135 static PyObject *
136 _io__IOBase_fileno_impl(PyObject *self);
137 
138 static PyObject *
_io__IOBase_fileno(PyObject * self,PyObject * Py_UNUSED (ignored))139 _io__IOBase_fileno(PyObject *self, PyObject *Py_UNUSED(ignored))
140 {
141     return _io__IOBase_fileno_impl(self);
142 }
143 
144 PyDoc_STRVAR(_io__IOBase_isatty__doc__,
145 "isatty($self, /)\n"
146 "--\n"
147 "\n"
148 "Return whether this is an \'interactive\' stream.\n"
149 "\n"
150 "Return False if it can\'t be determined.");
151 
152 #define _IO__IOBASE_ISATTY_METHODDEF    \
153     {"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__},
154 
155 static PyObject *
156 _io__IOBase_isatty_impl(PyObject *self);
157 
158 static PyObject *
_io__IOBase_isatty(PyObject * self,PyObject * Py_UNUSED (ignored))159 _io__IOBase_isatty(PyObject *self, PyObject *Py_UNUSED(ignored))
160 {
161     return _io__IOBase_isatty_impl(self);
162 }
163 
164 PyDoc_STRVAR(_io__IOBase_readline__doc__,
165 "readline($self, size=-1, /)\n"
166 "--\n"
167 "\n"
168 "Read and return a line from the stream.\n"
169 "\n"
170 "If size is specified, at most size bytes will be read.\n"
171 "\n"
172 "The line terminator is always b\'\\n\' for binary files; for text\n"
173 "files, the newlines argument to open can be used to select the line\n"
174 "terminator(s) recognized.");
175 
176 #define _IO__IOBASE_READLINE_METHODDEF    \
177     {"readline", (PyCFunction)_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__},
178 
179 static PyObject *
180 _io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
181 
182 static PyObject *
_io__IOBase_readline(PyObject * self,PyObject * const * args,Py_ssize_t nargs)183 _io__IOBase_readline(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
184 {
185     PyObject *return_value = NULL;
186     Py_ssize_t limit = -1;
187 
188     if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
189         _Py_convert_optional_to_ssize_t, &limit)) {
190         goto exit;
191     }
192     return_value = _io__IOBase_readline_impl(self, limit);
193 
194 exit:
195     return return_value;
196 }
197 
198 PyDoc_STRVAR(_io__IOBase_readlines__doc__,
199 "readlines($self, hint=-1, /)\n"
200 "--\n"
201 "\n"
202 "Return a list of lines from the stream.\n"
203 "\n"
204 "hint can be specified to control the number of lines read: no more\n"
205 "lines will be read if the total size (in bytes/characters) of all\n"
206 "lines so far exceeds hint.");
207 
208 #define _IO__IOBASE_READLINES_METHODDEF    \
209     {"readlines", (PyCFunction)_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__},
210 
211 static PyObject *
212 _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
213 
214 static PyObject *
_io__IOBase_readlines(PyObject * self,PyObject * const * args,Py_ssize_t nargs)215 _io__IOBase_readlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
216 {
217     PyObject *return_value = NULL;
218     Py_ssize_t hint = -1;
219 
220     if (!_PyArg_ParseStack(args, nargs, "|O&:readlines",
221         _Py_convert_optional_to_ssize_t, &hint)) {
222         goto exit;
223     }
224     return_value = _io__IOBase_readlines_impl(self, hint);
225 
226 exit:
227     return return_value;
228 }
229 
230 PyDoc_STRVAR(_io__IOBase_writelines__doc__,
231 "writelines($self, lines, /)\n"
232 "--\n"
233 "\n");
234 
235 #define _IO__IOBASE_WRITELINES_METHODDEF    \
236     {"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__},
237 
238 PyDoc_STRVAR(_io__RawIOBase_read__doc__,
239 "read($self, size=-1, /)\n"
240 "--\n"
241 "\n");
242 
243 #define _IO__RAWIOBASE_READ_METHODDEF    \
244     {"read", (PyCFunction)_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__},
245 
246 static PyObject *
247 _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n);
248 
249 static PyObject *
_io__RawIOBase_read(PyObject * self,PyObject * const * args,Py_ssize_t nargs)250 _io__RawIOBase_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
251 {
252     PyObject *return_value = NULL;
253     Py_ssize_t n = -1;
254 
255     if (!_PyArg_ParseStack(args, nargs, "|n:read",
256         &n)) {
257         goto exit;
258     }
259     return_value = _io__RawIOBase_read_impl(self, n);
260 
261 exit:
262     return return_value;
263 }
264 
265 PyDoc_STRVAR(_io__RawIOBase_readall__doc__,
266 "readall($self, /)\n"
267 "--\n"
268 "\n"
269 "Read until EOF, using multiple read() call.");
270 
271 #define _IO__RAWIOBASE_READALL_METHODDEF    \
272     {"readall", (PyCFunction)_io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__},
273 
274 static PyObject *
275 _io__RawIOBase_readall_impl(PyObject *self);
276 
277 static PyObject *
_io__RawIOBase_readall(PyObject * self,PyObject * Py_UNUSED (ignored))278 _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
279 {
280     return _io__RawIOBase_readall_impl(self);
281 }
282 /*[clinic end generated code: output=64989ec3dbf44a7c input=a9049054013a1b77]*/
283