diff options
author | Erlend E. Aasland <erlend@python.org> | 2023-08-27 20:35:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-27 20:35:27 (GMT) |
commit | 38afa4af9bfc8297a5ee270c37f3f120a04297ea (patch) | |
tree | c760b175eee35088efc7b0d5cfb557f25f3a1493 /Modules | |
parent | a429eafef2d86eafc007ac19682e7d372c32da31 (diff) | |
download | cpython-38afa4af9bfc8297a5ee270c37f3f120a04297ea.zip cpython-38afa4af9bfc8297a5ee270c37f3f120a04297ea.tar.gz cpython-38afa4af9bfc8297a5ee270c37f3f120a04297ea.tar.bz2 |
gh-107801: Document io.TextIOWrapper.tell (#108265)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/clinic/textio.c.h | 8 | ||||
-rw-r--r-- | Modules/_io/textio.c | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 03d5fac..ce6efbe 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -813,7 +813,11 @@ exit: PyDoc_STRVAR(_io_TextIOWrapper_tell__doc__, "tell($self, /)\n" "--\n" -"\n"); +"\n" +"Return the stream position as an opaque number.\n" +"\n" +"The return value of tell() can be given as input to seek(), to restore a\n" +"previous stream position."); #define _IO_TEXTIOWRAPPER_TELL_METHODDEF \ {"tell", (PyCFunction)_io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__}, @@ -976,4 +980,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=c3a8eb2591be1bf7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=390af0e65a0d02c0 input=a9049054013a1b77]*/ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index d87bd00..8e44d45 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -2640,11 +2640,16 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence) /*[clinic input] _io.TextIOWrapper.tell + +Return the stream position as an opaque number. + +The return value of tell() can be given as input to seek(), to restore a +previous stream position. [clinic start generated code]*/ static PyObject * _io_TextIOWrapper_tell_impl(textio *self) -/*[clinic end generated code: output=4f168c08bf34ad5f input=9a2caf88c24f9ddf]*/ +/*[clinic end generated code: output=4f168c08bf34ad5f input=0852d627d76fb520]*/ { PyObject *res; PyObject *posobj = NULL; |