diff options
author | Erlend E. Aasland <erlend@python.org> | 2023-08-27 23:59:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-27 23:59:48 (GMT) |
commit | f90099c3bd8ba74ac69ffd26cbc443ae3ce00e10 (patch) | |
tree | 64a57b8961521f091d7a0f1d9506c4abeee06b7e /Doc/library | |
parent | 311fd96dae5156b46e0eca982c12dd6bad00adf5 (diff) | |
download | cpython-f90099c3bd8ba74ac69ffd26cbc443ae3ce00e10.zip cpython-f90099c3bd8ba74ac69ffd26cbc443ae3ce00e10.tar.gz cpython-f90099c3bd8ba74ac69ffd26cbc443ae3ce00e10.tar.bz2 |
[3.12] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108547)
(cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/io.rst | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 792bf43..25f4d0d 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -1054,13 +1054,21 @@ Text I/O * ``seek(0, SEEK_SET)``: Rewind to the start of the stream. * ``seek(cookie, SEEK_SET)``: Restore a previous position; - *cookie* **must be** a number returned by :meth:`!tell`. + *cookie* **must be** a number returned by :meth:`tell`. * ``seek(0, SEEK_END)``: Fast-forward to the end of the stream. * ``seek(0, SEEK_CUR)``: Leave the current stream position unchanged. Any other argument combinations are invalid, and may raise exceptions. + .. method:: tell() + + Return the stream position as an opaque number. + The return value of :meth:`!tell` can be given as input to :meth:`seek`, + to restore a previous stream position. + + + .. class:: StringIO(initial_value='', newline='\n') A text stream using an in-memory text buffer. It inherits |