summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2023-08-27 21:22:43 (GMT)
committerGitHub <noreply@github.com>2023-08-27 21:22:43 (GMT)
commitbd951cd95b7436057067fd5b02c479008c6ead9e (patch)
tree49427a31411c0650e922888c21b8047dae2808e4 /Modules
parent73f89b145849e395420c74ec6b5c39fb2ae4b6a7 (diff)
downloadcpython-bd951cd95b7436057067fd5b02c479008c6ead9e.zip
cpython-bd951cd95b7436057067fd5b02c479008c6ead9e.tar.gz
cpython-bd951cd95b7436057067fd5b02c479008c6ead9e.tar.bz2
[3.11] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108548)
(cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/clinic/textio.c.h8
-rw-r--r--Modules/_io/textio.c7
2 files changed, 12 insertions, 3 deletions
diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h
index 91755dc..c220b44 100644
--- a/Modules/_io/clinic/textio.c.h
+++ b/Modules/_io/clinic/textio.c.h
@@ -526,7 +526,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__},
@@ -689,4 +693,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=f9bda53adf576a8e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4865229ff65da09a input=a9049054013a1b77]*/
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 403687d..7d5afb4 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2627,11 +2627,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;