Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
gh-101819: Adapt _io._BufferedIOBase_Type methods to Argument Clinic#104355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
98dd91b
fc14019
34c3e99
7c785b3
28fc57e
940db40
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -115,70 +115,83 @@ bufferediobase_unsupported(_PyIO_State *state, const char *message) | ||
/*[clinic input] | ||
_io._BufferedIOBase.detach | ||
cls: defining_class | ||
/ | ||
Disconnect this buffer from its underlying raw stream and return it. | ||
After the raw stream has been detached, the buffer is in an unusable | ||
state. | ||
[clinic start generated code]*/ | ||
static PyObject * | ||
_io__BufferedIOBase_detach_impl(PyObject *self, PyTypeObject *cls) | ||
/*[clinic end generated code: output=b87b135d67cd4448 input=0b61a7b4357c1ea7]*/ | ||
{ | ||
_PyIO_State *state = IO_STATE(); | ||
return bufferediobase_unsupported(state, "detach"); | ||
} | ||
/*[clinic input] | ||
_io._BufferedIOBase.read | ||
cls: defining_class | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
/ | ||
Read and return up to n bytes. | ||
If the argument is omitted, None, or negative, reads and returns all data until EOF. | ||
If the argument is positive, and the underlying raw stream is not 'interactive', multiple raw reads may be issued to satisfy the byte count (unless EOF is reached first). But for interactive raw streams (as well as sockets and pipes), at most one raw read will be issued, and a short result does not imply that EOF is imminent. | ||
arhadthedev marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Return an empty bytes object on EOF. | ||
Return None if the underlying raw stream was open in non-blocking mode and no data is available at the moment. | ||
[clinic start generated code]*/ | ||
static PyObject * | ||
_io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls) | ||
/*[clinic end generated code: output=905b1b6ea25c0aa5 input=a5ee8e4e31eddfe3]*/ | ||
{ | ||
_PyIO_State *state = IO_STATE(); | ||
return bufferediobase_unsupported(state, "read"); | ||
} | ||
/*[clinic input] | ||
_io._BufferedIOBase.read1 | ||
cls: defining_class | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
/ | ||
Read and return up to n bytes, with at most one read() call to the underlying raw stream. A short result does not imply that EOF is imminent. | ||
Return an empty bytes object on EOF. | ||
[clinic start generated code]*/ | ||
static PyObject * | ||
_io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls) | ||
/*[clinic end generated code: output=999785c4a78817bf input=8a1399f50844a8f9]*/ | ||
{ | ||
_PyIO_State *state = IO_STATE(); | ||
return bufferediobase_unsupported(state, "read1"); | ||
} | ||
/*[clinic input] | ||
_io._BufferedIOBase.write | ||
cls: defining_class | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
/ | ||
Write the given buffer to the IO stream. | ||
Return the number of bytes written, which is always the length of b in bytes. | ||
Raise BlockingIOError if the buffer is full and the underlying raw stream cannot accept more data at the moment. | ||
[clinic start generated code]*/ | ||
static PyObject * | ||
_io__BufferedIOBase_write_impl(PyObject *self, PyTypeObject *cls) | ||
/*[clinic end generated code: output=be944cf83e6f7356 input=dafbf71f2e70e1ff]*/ | ||
{ | ||
_PyIO_State *state = IO_STATE(); | ||
return bufferediobase_unsupported(state, "write"); | ||
@@ -2336,11 +2349,11 @@ _io_BufferedRandom___init___impl(buffered *self, PyObject *raw, | ||
static PyMethodDef bufferediobase_methods[] = { | ||
_IO__BUFFEREDIOBASE_DETACH_METHODDEF | ||
_IO__BUFFEREDIOBASE_READ_METHODDEF | ||
_IO__BUFFEREDIOBASE_READ1_METHODDEF | ||
_IO__BUFFEREDIOBASE_READINTO_METHODDEF | ||
_IO__BUFFEREDIOBASE_READINTO1_METHODDEF | ||
_IO__BUFFEREDIOBASE_WRITE_METHODDEF | ||
{NULL, NULL} | ||
}; | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.