From 189a24b09881032b7f3e773f082bab93f3164e00 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Tue, 23 Jan 2024 11:03:17 +0000 Subject: [PATCH] Doc: Apply suggestions from code review to Doc/library/stdtypes.rst Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> --- Doc/library/stdtypes.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 089cdd428d3062..23b6c2f75204ab 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1640,7 +1640,7 @@ expression support in the :mod:`re` module). >>> 'PYTHON IS AMAZING'.capitalize() 'Python is amazing' ->>> 'Njemačka Starts With a non-english Digraph'.capitalize() +>>> 'Njemačka Starts With a non-English Digraph'.capitalize() 'Njemačka starts with a non-english digraph' .. raw:: html @@ -1657,7 +1657,7 @@ expression support in the :mod:`re` module). intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold` - converts it to ``"ss"``, as follows. + converts it to ``"ss"``. The casefolding algorithm is `described in section 3.13 'Default Case Folding' of the Unicode Standard @@ -1698,6 +1698,8 @@ expression support in the :mod:`re` module). ' Python ' >>> 'Python'.center(10, '-') '--Python--' +>>> 'Python'.center(9) +' Python ' >>> 'Python'.center(4) 'Python' @@ -1787,7 +1789,7 @@ b'Python' Return ``True`` if the string ends with the specified *suffix*, otherwise return ``False``. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing - at that position. Use the *start* and *end* is equivalent to + at that position. Use of *start* and *end* is equivalent to ``str[start:end].endswith(suffix)``. See also :meth:`startswith` and :meth:`removesuffix`. @@ -1860,7 +1862,7 @@ True The :meth:`~str.find` method should be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the - :keyword:`in` operator. For example:: + :keyword:`in` operator:: >>> 'Py' in 'Python' True