From 937e8ddea1e635626a5df19bf1c4352ae19b2590 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Sun, 21 May 2017 20:51:29 -0400 Subject: [PATCH 1/5] bpo-23560: DOC:Add summary table for str methods in stdtypes.rst --- Doc/library/stdtypes.rst | 103 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 492b82b9a49443..83bce99757ebc2 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1376,6 +1376,108 @@ objects that compare equal might have different :attr:`~range.start`, single: str (built-in class); (see also string) object: string +.. _text-methods-summary: + +Text and Binary Sequence Type Methods Summary +============================================= +The following table summarizes the text and binary sequence types methods by +category. + + ++--------------------------+------------------------------+------------------------------+ +| Category | str methods | bytes methods | ++==========================+==============================+==============================+ +| Formatting | :meth:`str.format` | | ++ +------------------------------+------------------------------+ +| | :meth:`str.format_map` | | ++--------------------------+------------------------------+------------------------------+ +| Searching and Replacing | :meth:`str.find` | :meth:`bytes.find` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rfind` | :meth:`bytes.rfind` | ++ +------------------------------+------------------------------+ +| | :meth:`str.index` | :meth:`bytes.index` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rindex` | :meth:`bytes.rindex` | ++ +------------------------------+------------------------------+ +| | :meth:`str.startswith` | :meth:`bytes.startswith` | ++ +------------------------------+------------------------------+ +| | :meth:`str.endswith` | :meth:`bytes.endswith` | ++ +------------------------------+------------------------------+ +| | :meth:`str.count` | :meth:`bytes.count` | ++ +------------------------------+------------------------------+ +| | :meth:`str.replace` | :meth:`bytes.replace` | ++--------------------------+------------------------------+------------------------------+ +| Splitting and Joining | :meth:`str.split` | :meth:`bytes.split` | ++ +------------------------------+------------------------------+ +| | :meth:`str.splitlines` | :meth:`bytes.splitlines` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rsplit` | :meth:`bytes.rsplit` | ++ +------------------------------+------------------------------+ +| | :meth:`str.partition` | :meth:`bytes.partition` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rpartition` | :meth:`bytes.rpartition` | ++ +------------------------------+------------------------------+ +| | :meth:`str.join` | :meth:`bytes.join` | ++--------------------------+------------------------------+------------------------------+ +| String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isdecimal` | | ++ +------------------------------+------------------------------+ +| | :meth:`str.isdigit` | :meth:`bytes.isdigit` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isnumeric` | | ++ +------------------------------+------------------------------+ +| | :meth:`str.isalnum` | :meth:`bytes.isalnum` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isidentifier` | | ++ +------------------------------+------------------------------+ +| | :meth:`str.islower` | :meth:`bytes.islower` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isupper` | :meth:`bytes.isupper` | ++ +------------------------------+------------------------------+ +| | :meth:`str.istitle` | :meth:`bytes.istitle` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isspace` | :meth:`bytes.isspace` | ++ +------------------------------+------------------------------+ +| | :meth:`str.isprintable` | | ++--------------------------+------------------------------+------------------------------+ +| Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | ++ +------------------------------+------------------------------+ +| | :meth:`str.upper` | :meth:`bytes.upper` | ++ +------------------------------+------------------------------+ +| | :meth:`str.casefold` | | ++ +------------------------------+------------------------------+ +| | :meth:`str.capitalize` | :meth:`bytes.capitalize` | ++ +------------------------------+------------------------------+ +| | :meth:`str.title` | :meth:`bytes.title` | ++ +------------------------------+------------------------------+ +| | :meth:`str.swapcase` | :meth:`bytes.swapcase` | ++--------------------------+------------------------------+------------------------------+ +| Padding and Stripping | :meth:`str.ljust` | :meth:`bytes.ljust` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rjust` | :meth:`bytes.rjust` | ++ +------------------------------+------------------------------+ +| | :meth:`str.center` | :meth:`bytes.center` | ++ +------------------------------+------------------------------+ +| | :meth:`str.zfill` | :meth:`bytes.zfill` | ++ +------------------------------+------------------------------+ +| | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | ++ +------------------------------+------------------------------+ +| | :meth:`str.strip` | :meth:`bytes.strip` | ++ +------------------------------+------------------------------+ +| | :meth:`str.lstrip` | :meth:`bytes.lstrip` | ++ +------------------------------+------------------------------+ +| | :meth:`str.rstrip` | :meth:`bytes.rstrip` | ++--------------------------+------------------------------+------------------------------+ +| Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | ++ +------------------------------+------------------------------+ +| | :meth:`str.maketrans` | :meth:`bytes.maketrans` | ++ +------------------------------+------------------------------+ +| | :meth:`str.encode` | | ++ +------------------------------+------------------------------+ +| | | :meth:`bytes.decode` | ++--------------------------+------------------------------+------------------------------+ + .. _textseq: Text Sequence Type --- :class:`str` @@ -1464,6 +1566,7 @@ multiple fragments. sections. In addition, see the :ref:`stringservices` section. + .. index:: pair: string; methods From b3d447739d4fd23cac58b5e13a2e569e5fbc78ff Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Sat, 21 Oct 2017 11:26:20 -0400 Subject: [PATCH 2/5] Correct use of + where there was no intersection --- Doc/library/stdtypes.rst | 76 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 83bce99757ebc2..f09cc6b239fea7 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1388,93 +1388,93 @@ category. | Category | str methods | bytes methods | +==========================+==============================+==============================+ | Formatting | :meth:`str.format` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.format_map` | | +--------------------------+------------------------------+------------------------------+ | Searching and Replacing | :meth:`str.find` | :meth:`bytes.find` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rfind` | :meth:`bytes.rfind` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.index` | :meth:`bytes.index` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rindex` | :meth:`bytes.rindex` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.startswith` | :meth:`bytes.startswith` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.endswith` | :meth:`bytes.endswith` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.count` | :meth:`bytes.count` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.replace` | :meth:`bytes.replace` | +--------------------------+------------------------------+------------------------------+ | Splitting and Joining | :meth:`str.split` | :meth:`bytes.split` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.splitlines` | :meth:`bytes.splitlines` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rsplit` | :meth:`bytes.rsplit` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.partition` | :meth:`bytes.partition` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rpartition` | :meth:`bytes.rpartition` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.join` | :meth:`bytes.join` | +--------------------------+------------------------------+------------------------------+ | String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isdecimal` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isdigit` | :meth:`bytes.isdigit` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isnumeric` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isalnum` | :meth:`bytes.isalnum` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isidentifier` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.islower` | :meth:`bytes.islower` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isupper` | :meth:`bytes.isupper` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.istitle` | :meth:`bytes.istitle` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isspace` | :meth:`bytes.isspace` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.isprintable` | | +--------------------------+------------------------------+------------------------------+ | Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.upper` | :meth:`bytes.upper` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.casefold` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.capitalize` | :meth:`bytes.capitalize` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.title` | :meth:`bytes.title` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.swapcase` | :meth:`bytes.swapcase` | +--------------------------+------------------------------+------------------------------+ | Padding and Stripping | :meth:`str.ljust` | :meth:`bytes.ljust` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rjust` | :meth:`bytes.rjust` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.center` | :meth:`bytes.center` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.zfill` | :meth:`bytes.zfill` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.strip` | :meth:`bytes.strip` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.lstrip` | :meth:`bytes.lstrip` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.rstrip` | :meth:`bytes.rstrip` | +--------------------------+------------------------------+------------------------------+ | Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.maketrans` | :meth:`bytes.maketrans` | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | :meth:`str.encode` | | -+ +------------------------------+------------------------------+ +| +------------------------------+------------------------------+ | | | :meth:`bytes.decode` | +--------------------------+------------------------------+------------------------------+ From 7352386cb9f87b6888f733ebb286c60eebfaab32 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Sat, 21 Oct 2017 12:02:03 -0400 Subject: [PATCH 3/5] Reformat to show left and right on same row --- Doc/library/stdtypes.rst | 175 ++++++++++++++++++--------------------- 1 file changed, 81 insertions(+), 94 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f09cc6b239fea7..f25e52a482c72f 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1384,99 +1384,87 @@ The following table summarizes the text and binary sequence types methods by category. -+--------------------------+------------------------------+------------------------------+ -| Category | str methods | bytes methods | -+==========================+==============================+==============================+ -| Formatting | :meth:`str.format` | | -| +------------------------------+------------------------------+ -| | :meth:`str.format_map` | | -+--------------------------+------------------------------+------------------------------+ -| Searching and Replacing | :meth:`str.find` | :meth:`bytes.find` | -| +------------------------------+------------------------------+ -| | :meth:`str.rfind` | :meth:`bytes.rfind` | -| +------------------------------+------------------------------+ -| | :meth:`str.index` | :meth:`bytes.index` | -| +------------------------------+------------------------------+ -| | :meth:`str.rindex` | :meth:`bytes.rindex` | -| +------------------------------+------------------------------+ -| | :meth:`str.startswith` | :meth:`bytes.startswith` | -| +------------------------------+------------------------------+ -| | :meth:`str.endswith` | :meth:`bytes.endswith` | -| +------------------------------+------------------------------+ -| | :meth:`str.count` | :meth:`bytes.count` | -| +------------------------------+------------------------------+ -| | :meth:`str.replace` | :meth:`bytes.replace` | -+--------------------------+------------------------------+------------------------------+ -| Splitting and Joining | :meth:`str.split` | :meth:`bytes.split` | -| +------------------------------+------------------------------+ -| | :meth:`str.splitlines` | :meth:`bytes.splitlines` | -| +------------------------------+------------------------------+ -| | :meth:`str.rsplit` | :meth:`bytes.rsplit` | -| +------------------------------+------------------------------+ -| | :meth:`str.partition` | :meth:`bytes.partition` | -| +------------------------------+------------------------------+ -| | :meth:`str.rpartition` | :meth:`bytes.rpartition` | -| +------------------------------+------------------------------+ -| | :meth:`str.join` | :meth:`bytes.join` | -+--------------------------+------------------------------+------------------------------+ -| String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | -| +------------------------------+------------------------------+ -| | :meth:`str.isdecimal` | | -| +------------------------------+------------------------------+ -| | :meth:`str.isdigit` | :meth:`bytes.isdigit` | -| +------------------------------+------------------------------+ -| | :meth:`str.isnumeric` | | -| +------------------------------+------------------------------+ -| | :meth:`str.isalnum` | :meth:`bytes.isalnum` | -| +------------------------------+------------------------------+ -| | :meth:`str.isidentifier` | | -| +------------------------------+------------------------------+ -| | :meth:`str.islower` | :meth:`bytes.islower` | -| +------------------------------+------------------------------+ -| | :meth:`str.isupper` | :meth:`bytes.isupper` | -| +------------------------------+------------------------------+ -| | :meth:`str.istitle` | :meth:`bytes.istitle` | -| +------------------------------+------------------------------+ -| | :meth:`str.isspace` | :meth:`bytes.isspace` | -| +------------------------------+------------------------------+ -| | :meth:`str.isprintable` | | -+--------------------------+------------------------------+------------------------------+ -| Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | -| +------------------------------+------------------------------+ -| | :meth:`str.upper` | :meth:`bytes.upper` | -| +------------------------------+------------------------------+ -| | :meth:`str.casefold` | | -| +------------------------------+------------------------------+ -| | :meth:`str.capitalize` | :meth:`bytes.capitalize` | -| +------------------------------+------------------------------+ -| | :meth:`str.title` | :meth:`bytes.title` | -| +------------------------------+------------------------------+ -| | :meth:`str.swapcase` | :meth:`bytes.swapcase` | -+--------------------------+------------------------------+------------------------------+ -| Padding and Stripping | :meth:`str.ljust` | :meth:`bytes.ljust` | -| +------------------------------+------------------------------+ -| | :meth:`str.rjust` | :meth:`bytes.rjust` | -| +------------------------------+------------------------------+ -| | :meth:`str.center` | :meth:`bytes.center` | -| +------------------------------+------------------------------+ -| | :meth:`str.zfill` | :meth:`bytes.zfill` | -| +------------------------------+------------------------------+ -| | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | -| +------------------------------+------------------------------+ -| | :meth:`str.strip` | :meth:`bytes.strip` | -| +------------------------------+------------------------------+ -| | :meth:`str.lstrip` | :meth:`bytes.lstrip` | -| +------------------------------+------------------------------+ -| | :meth:`str.rstrip` | :meth:`bytes.rstrip` | -+--------------------------+------------------------------+------------------------------+ -| Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | -| +------------------------------+------------------------------+ -| | :meth:`str.maketrans` | :meth:`bytes.maketrans` | -| +------------------------------+------------------------------+ -| | :meth:`str.encode` | | -| +------------------------------+------------------------------+ -| | | :meth:`bytes.decode` | -+--------------------------+------------------------------+------------------------------+ ++--------------------------+----------------------------------------+---------------------------------------------+ +| Category | :class:`str` methods |:class:`bytes` and :class:`bytearray` methods| ++==========================+========================================+=============================================+ +| Formatting | :meth:`str.format` | | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.format_map` | | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| Searching and Replacing | :meth:`str.find` | :meth:`str.rfind` | :meth:`bytes.find` | :meth:`bytes.rfind` | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.index` | :meth:`str.rindex` | :meth:`bytes.index` | :meth:`bytes.rindex` | +| +-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.startswith` | :meth:`bytes.startswith` | +| +-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.endswith` | :meth:`bytes.endswith` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.count` | :meth:`bytes.count` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.replace` | :meth:`bytes.replace` | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| Splitting and Joining | :meth:`str.split` | :meth:`str.rsplit` | :meth:`bytes.split` | :meth:`bytes.rsplit` | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.splitlines` | :meth:`bytes.splitlines` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.partition` | :meth:`bytes.partition` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.rpartition` | :meth:`bytes.rpartition` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.join` | :meth:`bytes.join` | ++--------------------------+----------------------------------------+---------------------------------------------+ +| String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isdecimal` | | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isdigit` | :meth:`bytes.isdigit` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isnumeric` | | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isalnum` | :meth:`bytes.isalnum` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isidentifier` | | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.islower` | :meth:`bytes.islower` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isupper` | :meth:`bytes.isupper` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.istitle` | :meth:`bytes.istitle` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isspace` | :meth:`bytes.isspace` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.isprintable` | | ++--------------------------+----------------------------------------+---------------------------------------------+ +| Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.upper` | :meth:`bytes.upper` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.casefold` | | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.capitalize` | :meth:`bytes.capitalize` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.title` | :meth:`bytes.title` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.swapcase` | :meth:`bytes.swapcase` | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| Padding and Stripping | :meth:`str.ljust` | :meth:`str.rjust` | :meth:`bytes.ljust` | :meth:`bytes.rjust` | +| +-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.center` | :meth:`bytes.center` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.strip` | :meth:`bytes.strip` | +| +-------------------+--------------------+----------------------+----------------------+ +| | :meth:`str.lstrip`| :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | ++--------------------------+-------------------+--------------------+----------------------+----------------------+ +| Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.maketrans` | :meth:`bytes.maketrans` | +| +----------------------------------------+---------------------------------------------+ +| | :meth:`str.encode` | | +| +----------------------------------------+---------------------------------------------+ +| | | :meth:`bytes.decode` | ++--------------------------+----------------------------------------+---------------------------------------------+ .. _textseq: @@ -1566,7 +1554,6 @@ multiple fragments. sections. In addition, see the :ref:`stringservices` section. - .. index:: pair: string; methods From b577580bf3ab2e111d4e370bb3314850dfabe562 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Sat, 21 Oct 2017 12:45:24 -0400 Subject: [PATCH 4/5] Add other methods of string formatting --- Doc/library/stdtypes.rst | 166 ++++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 81 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f25e52a482c72f..374a5b2b22d9a0 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1384,87 +1384,91 @@ The following table summarizes the text and binary sequence types methods by category. -+--------------------------+----------------------------------------+---------------------------------------------+ -| Category | :class:`str` methods |:class:`bytes` and :class:`bytearray` methods| -+==========================+========================================+=============================================+ -| Formatting | :meth:`str.format` | | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.format_map` | | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| Searching and Replacing | :meth:`str.find` | :meth:`str.rfind` | :meth:`bytes.find` | :meth:`bytes.rfind` | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.index` | :meth:`str.rindex` | :meth:`bytes.index` | :meth:`bytes.rindex` | -| +-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.startswith` | :meth:`bytes.startswith` | -| +-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.endswith` | :meth:`bytes.endswith` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.count` | :meth:`bytes.count` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.replace` | :meth:`bytes.replace` | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| Splitting and Joining | :meth:`str.split` | :meth:`str.rsplit` | :meth:`bytes.split` | :meth:`bytes.rsplit` | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.splitlines` | :meth:`bytes.splitlines` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.partition` | :meth:`bytes.partition` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.rpartition` | :meth:`bytes.rpartition` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.join` | :meth:`bytes.join` | -+--------------------------+----------------------------------------+---------------------------------------------+ -| String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isdecimal` | | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isdigit` | :meth:`bytes.isdigit` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isnumeric` | | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isalnum` | :meth:`bytes.isalnum` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isidentifier` | | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.islower` | :meth:`bytes.islower` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isupper` | :meth:`bytes.isupper` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.istitle` | :meth:`bytes.istitle` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isspace` | :meth:`bytes.isspace` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.isprintable` | | -+--------------------------+----------------------------------------+---------------------------------------------+ -| Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.upper` | :meth:`bytes.upper` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.casefold` | | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.capitalize` | :meth:`bytes.capitalize` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.title` | :meth:`bytes.title` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.swapcase` | :meth:`bytes.swapcase` | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| Padding and Stripping | :meth:`str.ljust` | :meth:`str.rjust` | :meth:`bytes.ljust` | :meth:`bytes.rjust` | -| +-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.center` | :meth:`bytes.center` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.strip` | :meth:`bytes.strip` | -| +-------------------+--------------------+----------------------+----------------------+ -| | :meth:`str.lstrip`| :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | -+--------------------------+-------------------+--------------------+----------------------+----------------------+ -| Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.maketrans` | :meth:`bytes.maketrans` | -| +----------------------------------------+---------------------------------------------+ -| | :meth:`str.encode` | | -| +----------------------------------------+---------------------------------------------+ -| | | :meth:`bytes.decode` | -+--------------------------+----------------------------------------+---------------------------------------------+ ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| Category | :class:`str` methods | :class:`bytes` and :class:`bytearray` methods | ++==========================+===========================================+===================================================+ +| Formatting | :meth:`str.format` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.format_map` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :ref:`f-strings` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :ref:`old-string-formatting` | :ref:`bytes-formatting` | ++--------------------------+------------------+------------------------+--------------------+------------------------------+ +| Searching and Replacing | :meth:`str.find` | :meth:`str.rfind` | :meth:`bytes.find` | :meth:`bytes.rfind` | ++--------------------------+------------------+------------------------+--------------------+------------------------------+ +| | :meth:`str.index`| :meth:`str.rindex` | :meth:`bytes.index`| :meth:`bytes.rindex` | +| +------------------+------------------------+--------------------+------------------------------+ +| | :meth:`str.startswith` | :meth:`bytes.startswith` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.endswith` | :meth:`bytes.endswith` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.count` | :meth:`bytes.count` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.replace` | :meth:`bytes.replace` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| Splitting and Joining | :meth:`str.split` | :meth:`str.rsplit` | :meth:`bytes.split` | :meth:`bytes.rsplit` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.splitlines` | :meth:`bytes.splitlines` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.partition` | :meth:`bytes.partition` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.rpartition` | :meth:`bytes.rpartition` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.join` | :meth:`bytes.join` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| String Classification | :meth:`str.isalpha` | :meth:`bytes.isalpha` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isdecimal` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isdigit` | :meth:`bytes.isdigit` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isnumeric` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isalnum` | :meth:`bytes.isalnum` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isidentifier` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.islower` | :meth:`bytes.islower` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isupper` | :meth:`bytes.isupper` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.istitle` | :meth:`bytes.istitle` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isspace` | :meth:`bytes.isspace` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.isprintable` | | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| Case Manipulation | :meth:`str.lower` | :meth:`bytes.lower` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.upper` | :meth:`bytes.upper` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.casefold` | | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.capitalize` | :meth:`bytes.capitalize` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.title` | :meth:`bytes.title` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.swapcase` | :meth:`bytes.swapcase` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| Padding and Stripping | :meth:`str.ljust` | :meth:`str.rjust` | :meth:`bytes.ljust` | :meth:`bytes.rjust` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.center` | :meth:`bytes.center` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.strip` | :meth:`bytes.strip` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.lstrip` | :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ +| Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.maketrans` | :meth:`bytes.maketrans` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.encode` | | +| +-------------------------------------------+---------------------------------------------------+ +| | | :meth:`bytes.decode` | ++--------------------------+-------------------------------------------+---------------------------------------------------+ .. _textseq: From f1a2a6d8b10179e436686789a3bdbc55fbc39476 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 7 Jan 2025 14:33:48 +0100 Subject: [PATCH 5/5] Fix table formatting --- Doc/library/stdtypes.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 93031d2c2f1f4f..6050784264707b 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1568,7 +1568,7 @@ category. | | :ref:`old-string-formatting` | :ref:`bytes-formatting` | +--------------------------+------------------+------------------------+--------------------+------------------------------+ | Searching and Replacing | :meth:`str.find` | :meth:`str.rfind` | :meth:`bytes.find` | :meth:`bytes.rfind` | -+--------------------------+------------------+------------------------+--------------------+------------------------------+ +| +------------------+------------------------+--------------------+------------------------------+ | | :meth:`str.index`| :meth:`str.rindex` | :meth:`bytes.index`| :meth:`bytes.rindex` | | +------------------+------------------------+--------------------+------------------------------+ | | :meth:`str.startswith` | :meth:`bytes.startswith` | @@ -1578,9 +1578,9 @@ category. | | :meth:`str.count` | :meth:`bytes.count` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.replace` | :meth:`bytes.replace` | -+--------------------------+-------------------------------------------+---------------------------------------------------+ ++--------------------------+-------------------+-----------------------+---------------------+-----------------------------+ | Splitting and Joining | :meth:`str.split` | :meth:`str.rsplit` | :meth:`bytes.split` | :meth:`bytes.rsplit` | -+--------------------------+-------------------------------------------+---------------------------------------------------+ +| +-------------------+-----------------------+---------------------+-----------------------------+ | | :meth:`str.splitlines` | :meth:`bytes.splitlines` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.partition` | :meth:`bytes.partition` | @@ -1622,17 +1622,17 @@ category. | | :meth:`str.title` | :meth:`bytes.title` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.swapcase` | :meth:`bytes.swapcase` | -+--------------------------+-------------------------------------------+---------------------------------------------------+ ++--------------------------+-------------------+-----------------------+---------------------+-----------------------------+ | Padding and Stripping | :meth:`str.ljust` | :meth:`str.rjust` | :meth:`bytes.ljust` | :meth:`bytes.rjust` | -| +-------------------------------------------+---------------------------------------------------+ +| +-------------------+-----------------------+---------------------+-----------------------------+ | | :meth:`str.center` | :meth:`bytes.center` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.expandtabs` | :meth:`bytes.expandtabs` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.strip` | :meth:`bytes.strip` | -| +-------------------------------------------+---------------------------------------------------+ +| +--------------------+----------------------+----------------------+----------------------------+ | | :meth:`str.lstrip` | :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | -+--------------------------+-------------------------------------------+---------------------------------------------------+ ++--------------------------+--------------------+----------------------+----------------------+----------------------------+ | Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.maketrans` | :meth:`bytes.maketrans` |