From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:50:16 +0000 (+0200) Subject: [3.14] gh-106318: Add example for `str.expandtabs()` (GH-134525) (#135476) X-Git-Tag: v3.14.0b3~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9db299afa0f576a0c07e3134e44de8ee64a733f;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-106318: Add example for `str.expandtabs()` (GH-134525) (#135476) Co-authored-by: Blaise Pabon --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0954e3409a2d..394c302fd354 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1891,12 +1891,15 @@ expression support in the :mod:`re` module). (``\n``) or return (``\r``), it is copied and the current column is reset to zero. Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when - printed. + printed. For example:: >>> '01\t012\t0123\t01234'.expandtabs() '01 012 0123 01234' >>> '01\t012\t0123\t01234'.expandtabs(4) '01 012 0123 01234' + >>> print('01\t012\n0123\t01234'.expandtabs(4)) + 01 012 + 0123 01234 .. method:: str.find(sub[, start[, end]])