From 53eca7bdf3252803ea71cbdea2c2a491fa799497 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 18 Aug 2023 10:36:21 +0200 Subject: [PATCH 1/8] Docs: Fix Sphinx warnings in sys.rst - Mark up named tuple attributes using :attr:`!member` - Remove links for external functions - io.BufferedIOBase has no 'buffer' attribute; remove the link and mark up using :attr:`!buffer` --- Doc/library/sys.rst | 96 ++++++++++++++++++++++---------------------- Doc/tools/.nitignore | 1 - 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 33391d11ab392d..a58786d13d023e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -338,16 +338,16 @@ always available. +-----------------------------+----------------------------------------------+ | Attribute | Explanation | +=============================+==============================================+ - | :const:`emscripten_version` | Emscripten version as tuple of ints | + | :attr:`!emscripten_version` | Emscripten version as tuple of ints | | | (major, minor, micro), e.g. ``(3, 1, 8)``. | +-----------------------------+----------------------------------------------+ - | :const:`runtime` | Runtime string, e.g. browser user agent, | + | :attr:`!runtime` | Runtime string, e.g. browser user agent, | | | ``'Node.js v14.18.2'``, or ``'UNKNOWN'``. | +-----------------------------+----------------------------------------------+ - | :const:`pthreads` | ``True`` if Python is compiled with | + | :attr:`!pthreads` | ``True`` if Python is compiled with | | | Emscripten pthreads support. | +-----------------------------+----------------------------------------------+ - | :const:`shared_memory` | ``True`` if Python is compiled with shared | + | :attr:`!shared_memory` | ``True`` if Python is compiled with shared | | | memory support. | +-----------------------------+----------------------------------------------+ @@ -518,24 +518,24 @@ always available. ============================== ============================================================================================================== attribute flag ============================== ============================================================================================================== - :const:`debug` :option:`-d` - :const:`inspect` :option:`-i` - :const:`interactive` :option:`-i` - :const:`isolated` :option:`-I` - :const:`optimize` :option:`-O` or :option:`-OO` - :const:`dont_write_bytecode` :option:`-B` - :const:`no_user_site` :option:`-s` - :const:`no_site` :option:`-S` - :const:`ignore_environment` :option:`-E` - :const:`verbose` :option:`-v` - :const:`bytes_warning` :option:`-b` - :const:`quiet` :option:`-q` - :const:`hash_randomization` :option:`-R` - :const:`dev_mode` :option:`-X dev <-X>` (:ref:`Python Development Mode `) - :const:`utf8_mode` :option:`-X utf8 <-X>` - :const:`safe_path` :option:`-P` - :const:`int_max_str_digits` :option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length limitation `) - :const:`warn_default_encoding` :option:`-X warn_default_encoding <-X>` + :attr:`!debug` :option:`-d` + :attr:`!inspect` :option:`-i` + :attr:`!interactive` :option:`-i` + :attr:`!isolated` :option:`-I` + :attr:`!optimize` :option:`-O` or :option:`-OO` + :attr:`!dont_write_bytecode` :option:`-B` + :attr:`!no_user_site` :option:`-s` + :attr:`!no_site` :option:`-S` + :attr:`!ignore_environment` :option:`-E` + :attr:`!verbose` :option:`-v` + :attr:`!bytes_warning` :option:`-b` + :attr:`!quiet` :option:`-q` + :attr:`!hash_randomization` :option:`-R` + :attr:`!dev_mode` :option:`-X dev <-X>` (:ref:`Python Development Mode `) + :attr:`!utf8_mode` :option:`-X utf8 <-X>` + :attr:`!safe_path` :option:`-P` + :attr:`!int_max_str_digits` :option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length limitation `) + :attr:`!warn_default_encoding` :option:`-X warn_default_encoding <-X>` ============================== ============================================================================================================== .. versionchanged:: 3.2 @@ -626,9 +626,9 @@ always available. | | | implementation-defined rounding behavior. | +---------------------+---------------------+--------------------------------------------------+ - The attribute :attr:`sys.float_info.dig` needs further explanation. If - ``s`` is any string representing a decimal number with at most - :attr:`sys.float_info.dig` significant digits, then converting ``s`` to a + The attribute :attr:`!sys.float_info.dig` needs further explanation. + If ``s`` is any string representing a decimal number with at most + :attr:`!sys.float_info.dig` significant digits, then converting ``s`` to a float and back again will recover a string representing the same decimal value:: @@ -639,7 +639,7 @@ always available. >>> format(float(s), '.15g') # convert to float and back -> same value '3.14159265358979' - But for strings with more than :attr:`sys.float_info.dig` significant digits, + But for strings with more than :attr:`!sys.float_info.dig` significant digits, this isn't always true:: >>> s = '9876543211234567' # 16 significant digits is too many! @@ -902,8 +902,8 @@ always available. | | a domain controller. | +---------------------------------------+---------------------------------+ - This function wraps the Win32 :c:func:`GetVersionEx` function; see the - Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information + This function wraps the Win32 :c:func:`!GetVersionEx` function; see the + Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information about these fields. *platform_version* returns the major version, minor version and @@ -964,23 +964,23 @@ always available. +---------------------+--------------------------------------------------+ | attribute | explanation | +=====================+==================================================+ - | :const:`width` | width in bits used for hash values | + | :attr:`!width` | width in bits used for hash values | +---------------------+--------------------------------------------------+ - | :const:`modulus` | prime modulus P used for numeric hash scheme | + | :attr:`!modulus` | prime modulus P used for numeric hash scheme | +---------------------+--------------------------------------------------+ - | :const:`inf` | hash value returned for a positive infinity | + | :attr:`!inf` | hash value returned for a positive infinity | +---------------------+--------------------------------------------------+ - | :const:`nan` | (this attribute is no longer used) | + | :attr:`!nan` | (this attribute is no longer used) | +---------------------+--------------------------------------------------+ - | :const:`imag` | multiplier used for the imaginary part of a | + | :attr:`!imag` | multiplier used for the imaginary part of a | | | complex number | +---------------------+--------------------------------------------------+ - | :const:`algorithm` | name of the algorithm for hashing of str, bytes, | + | :attr:`!algorithm` | name of the algorithm for hashing of str, bytes, | | | and memoryview | +---------------------+--------------------------------------------------+ - | :const:`hash_bits` | internal output size of the hash algorithm | + | :attr:`!hash_bits` | internal output size of the hash algorithm | +---------------------+--------------------------------------------------+ - | :const:`seed_bits` | size of the seed key of the hash algorithm | + | :attr:`!seed_bits` | size of the seed key of the hash algorithm | +---------------------+--------------------------------------------------+ @@ -1065,18 +1065,18 @@ always available. +----------------------------------------+-----------------------------------------------+ | Attribute | Explanation | +========================================+===============================================+ - | :const:`bits_per_digit` | number of bits held in each digit. Python | + | :attr:`!bits_per_digit` | number of bits held in each digit. Python | | | integers are stored internally in base | | | ``2**int_info.bits_per_digit`` | +----------------------------------------+-----------------------------------------------+ - | :const:`sizeof_digit` | size in bytes of the C type used to | + | :attr:`!sizeof_digit` | size in bytes of the C type used to | | | represent a digit | +----------------------------------------+-----------------------------------------------+ - | :const:`default_max_str_digits` | default value for | + | :attr:`!default_max_str_digits` | default value for | | | :func:`sys.get_int_max_str_digits` when it | | | is not otherwise explicitly configured. | +----------------------------------------+-----------------------------------------------+ - | :const:`str_digits_check_threshold` | minimum non-zero value for | + | :attr:`!str_digits_check_threshold` | minimum non-zero value for | | | :func:`sys.set_int_max_str_digits`, | | | :envvar:`PYTHONINTMAXSTRDIGITS`, or | | | :option:`-X int_max_str_digits <-X>`. | @@ -1512,7 +1512,7 @@ always available. :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this works. Per-line events may be disabled for a frame by setting - :attr:`f_trace_lines` to :const:`False` on that frame. + :attr:`!f_trace_lines` to :const:`False` on that frame. ``'return'`` A function (or other code block) is about to return. The local trace @@ -1530,7 +1530,7 @@ always available. opcode details). The local trace function is called; *arg* is ``None``; the return value specifies the new local trace function. Per-opcode events are not emitted by default: they must be explicitly - requested by setting :attr:`f_trace_opcodes` to :const:`True` on the + requested by setting :attr:`!f_trace_opcodes` to :const:`True` on the frame. Note that as an exception is propagated down the chain of callers, an @@ -1560,8 +1560,8 @@ always available. .. versionchanged:: 3.7 - ``'opcode'`` event type added; :attr:`f_trace_lines` and - :attr:`f_trace_opcodes` attributes added to frames + ``'opcode'`` event type added; :attr:`!f_trace_lines` and + :attr:`!f_trace_opcodes` attributes added to frames .. function:: set_asyncgen_hooks(firstiter, finalizer) @@ -1718,7 +1718,7 @@ always available. However, if you are writing a library (and do not control in which context its code will be executed), be aware that the standard streams may be replaced with file-like objects like :class:`io.StringIO` which - do not support the :attr:`~io.BufferedIOBase.buffer` attribute. + do not support the :attr:!buffer` attribute. .. data:: __stdin__ @@ -1771,7 +1771,7 @@ always available. +------------------+---------------------------------------------------------+ | Attribute | Explanation | +==================+=========================================================+ - | :const:`name` | Name of the thread implementation: | + | :attr:`!name` | Name of the thread implementation: | | | | | | * ``'nt'``: Windows threads | | | * ``'pthread'``: POSIX threads | @@ -1779,14 +1779,14 @@ always available. | | (on WebAssembly platforms without threading support) | | | * ``'solaris'``: Solaris threads | +------------------+---------------------------------------------------------+ - | :const:`lock` | Name of the lock implementation: | + | :attr:`!lock` | Name of the lock implementation: | | | | | | * ``'semaphore'``: a lock uses a semaphore | | | * ``'mutex+cond'``: a lock uses a mutex | | | and a condition variable | | | * ``None`` if this information is unknown | +------------------+---------------------------------------------------------+ - | :const:`version` | Name and version of the thread library. It is a string, | + | :attr:`!version` | Name and version of the thread library. It is a string, | | | or ``None`` if this information is unknown. | +------------------+---------------------------------------------------------+ diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 654287cc50b55b..ff7c3882c66802 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -18,7 +18,6 @@ Doc/c-api/object.rst Doc/c-api/set.rst Doc/c-api/stable.rst Doc/c-api/structures.rst -Doc/c-api/sys.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst From 810dff7846c4c8ce7b78f5f79fc5f6f1bf1d4dcf Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 18 Aug 2023 11:11:17 +0200 Subject: [PATCH 2/8] Nitignore the correct file --- Doc/tools/.nitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index ff7c3882c66802..622237e14318ad 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -18,6 +18,7 @@ Doc/c-api/object.rst Doc/c-api/set.rst Doc/c-api/stable.rst Doc/c-api/structures.rst +Doc/c-api/sys.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst @@ -126,7 +127,6 @@ Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst -Doc/library/sys.rst Doc/library/sys_path_init.rst Doc/library/syslog.rst Doc/library/tarfile.rst From 4b278bb58c178212dd4267de4211c1f7eeecaeea Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 19 Aug 2023 14:30:10 +0200 Subject: [PATCH 3/8] Apply suggestions from code review Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/library/sys.rst | 248 +++++++++++++++++++++++++------------------- 1 file changed, 143 insertions(+), 105 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a920b1659b1654..9cd5c2d1ae3d23 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -333,23 +333,21 @@ always available. *wasm32-emscripten* platform. The named tuple is provisional and may change in the future. - .. tabularcolumns:: |l|L| - - +-----------------------------+----------------------------------------------+ - | Attribute | Explanation | - +=============================+==============================================+ - | :attr:`!emscripten_version` | Emscripten version as tuple of ints | - | | (major, minor, micro), e.g. ``(3, 1, 8)``. | - +-----------------------------+----------------------------------------------+ - | :attr:`!runtime` | Runtime string, e.g. browser user agent, | - | | ``'Node.js v14.18.2'``, or ``'UNKNOWN'``. | - +-----------------------------+----------------------------------------------+ - | :attr:`!pthreads` | ``True`` if Python is compiled with | - | | Emscripten pthreads support. | - +-----------------------------+----------------------------------------------+ - | :attr:`!shared_memory` | ``True`` if Python is compiled with shared | - | | memory support. | - +-----------------------------+----------------------------------------------+ + .. attribute:: _emscripten_info.emscripten_version + + Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, 8)``. + + .. attribute:: _emscripten_info.runtime + + Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or ``'UNKNOWN'``. + + .. attribute:: _emscripten_info.pthreads + + ``True`` if Python is compiled with Emscripten pthreads support. + + .. attribute:: _emscripten_info.shared_memory + + ``True`` if Python is compiled with shared memory support. .. availability:: Emscripten. @@ -515,28 +513,62 @@ always available. The :term:`named tuple` *flags* exposes the status of command line flags. The attributes are read only. - ============================== ============================================================================================================== - attribute flag - ============================== ============================================================================================================== - :attr:`!debug` :option:`-d` - :attr:`!inspect` :option:`-i` - :attr:`!interactive` :option:`-i` - :attr:`!isolated` :option:`-I` - :attr:`!optimize` :option:`-O` or :option:`-OO` - :attr:`!dont_write_bytecode` :option:`-B` - :attr:`!no_user_site` :option:`-s` - :attr:`!no_site` :option:`-S` - :attr:`!ignore_environment` :option:`-E` - :attr:`!verbose` :option:`-v` - :attr:`!bytes_warning` :option:`-b` - :attr:`!quiet` :option:`-q` - :attr:`!hash_randomization` :option:`-R` - :attr:`!dev_mode` :option:`-X dev <-X>` (:ref:`Python Development Mode `) - :attr:`!utf8_mode` :option:`-X utf8 <-X>` - :attr:`!safe_path` :option:`-P` - :attr:`!int_max_str_digits` :option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length limitation `) - :attr:`!warn_default_encoding` :option:`-X warn_default_encoding <-X>` - ============================== ============================================================================================================== + .. list-table:: + + * - .. attribute:: flags.debug + - :option:`-d` + + * - .. attribute:: flags.inspect + - :option:`-i` + + * - .. attribute:: flags.interactive + - :option:`-i` + + * - .. attribute:: flags.isolated + - :option:`-I` + + * - .. attribute:: flags.optimize + - :option:`-O` or :option:`-OO` + + * - .. attribute:: flags.dont_write_bytecode + - :option:`-B` + + * - .. attribute:: flags.no_user_site + - :option:`-s` + + * - .. attribute:: flags.no_site + - :option:`-S` + + * - .. attribute:: flags.ignore_environment + - :option:`-E` + + * - .. attribute:: flags.verbose + - :option:`-v` + + * - .. attribute:: flags.bytes_warning + - :option:`-b` + + * - .. attribute:: flags.quiet + - :option:`-q` + + * - .. attribute:: flags.hash_randomization + - :option:`-R` + + * - .. attribute:: flags.dev_mode + - :option:`-X dev <-X>` (:ref:`Python Development Mode `) + + * - .. attribute:: flags.utf8_mode + - :option:`-X utf8 <-X>` + + * - .. attribute:: flags.safe_path + - :option:`-P` + + * - .. attribute:: flags.int_max_str_digits + - :option:`-X int_max_str_digits <-X>` + (:ref:`integer string conversion length limitation `) + + * - .. attribute:: flags.warn_default_encoding + - :option:`-X warn_default_encoding <-X>` .. versionchanged:: 3.2 Added ``quiet`` attribute for the new :option:`-q` flag. @@ -982,28 +1014,37 @@ always available. implementation. For more details about hashing of numeric types, see :ref:`numeric-hash`. - +---------------------+--------------------------------------------------+ - | attribute | explanation | - +=====================+==================================================+ - | :attr:`!width` | width in bits used for hash values | - +---------------------+--------------------------------------------------+ - | :attr:`!modulus` | prime modulus P used for numeric hash scheme | - +---------------------+--------------------------------------------------+ - | :attr:`!inf` | hash value returned for a positive infinity | - +---------------------+--------------------------------------------------+ - | :attr:`!nan` | (this attribute is no longer used) | - +---------------------+--------------------------------------------------+ - | :attr:`!imag` | multiplier used for the imaginary part of a | - | | complex number | - +---------------------+--------------------------------------------------+ - | :attr:`!algorithm` | name of the algorithm for hashing of str, bytes, | - | | and memoryview | - +---------------------+--------------------------------------------------+ - | :attr:`!hash_bits` | internal output size of the hash algorithm | - +---------------------+--------------------------------------------------+ - | :attr:`!seed_bits` | size of the seed key of the hash algorithm | - +---------------------+--------------------------------------------------+ + .. attribute:: hash_info.width + + The width in bits used for hash values + + .. attribute:: hash_info.modulus + The prime modulus P used for numeric hash scheme + + .. attribute:: hash_info.inf + + The hash value returned for a positive infinity + + .. attribute:: hash_info.nan + + (This attribute is no longer used) + + .. attribute:: hash_info.imag + + The multiplier used for the imaginary part of a complex number + + .. attribute:: hash_info.algorithm + + The name of the algorithm for hashing of str, bytes, and memoryview + + .. attribute:: hash_info.hash_bits + + The internal output size of the hash algorithm + + .. attribute:: hash_info.seed_bits + + The size of the seed key of the hash algorithm .. versionadded:: 3.2 @@ -1081,32 +1122,30 @@ always available. A :term:`named tuple` that holds information about Python's internal representation of integers. The attributes are read only. - .. tabularcolumns:: |l|L| - - +----------------------------------------+-----------------------------------------------+ - | Attribute | Explanation | - +========================================+===============================================+ - | :attr:`!bits_per_digit` | number of bits held in each digit. Python | - | | integers are stored internally in base | - | | ``2**int_info.bits_per_digit`` | - +----------------------------------------+-----------------------------------------------+ - | :attr:`!sizeof_digit` | size in bytes of the C type used to | - | | represent a digit | - +----------------------------------------+-----------------------------------------------+ - | :attr:`!default_max_str_digits` | default value for | - | | :func:`sys.get_int_max_str_digits` when it | - | | is not otherwise explicitly configured. | - +----------------------------------------+-----------------------------------------------+ - | :attr:`!str_digits_check_threshold` | minimum non-zero value for | - | | :func:`sys.set_int_max_str_digits`, | - | | :envvar:`PYTHONINTMAXSTRDIGITS`, or | - | | :option:`-X int_max_str_digits <-X>`. | - +----------------------------------------+-----------------------------------------------+ + .. attribute:: int_info.bits_per_digit + + The number of bits held in each digit. + Python integers are stored internally in base ``2**int_info.bits_per_digit``. + + .. attribute:: int_info.sizeof_digit + + The size in bytes of the C type used to represent a digit. + + .. attribute:: int_info.default_max_str_digits + + The default value for :func:`sys.get_int_max_str_digits` + when it is not otherwise explicitly configured. + + .. attribute:: int_info.str_digits_check_threshold + + The minimum non-zero value for :func:`sys.set_int_max_str_digits`, + :envvar:`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`. .. versionadded:: 3.1 .. versionchanged:: 3.11 - Added ``default_max_str_digits`` and ``str_digits_check_threshold``. + + Added :attr:`int_info.default_max_str_digits` and :attr:`int_info.str_digits_check_threshold`. .. data:: __interactivehook__ @@ -1787,29 +1826,28 @@ always available. A :term:`named tuple` holding information about the thread implementation. - .. tabularcolumns:: |l|p{0.7\linewidth}| - - +------------------+---------------------------------------------------------+ - | Attribute | Explanation | - +==================+=========================================================+ - | :attr:`!name` | Name of the thread implementation: | - | | | - | | * ``'nt'``: Windows threads | - | | * ``'pthread'``: POSIX threads | - | | * ``'pthread-stubs'``: stub POSIX threads | - | | (on WebAssembly platforms without threading support) | - | | * ``'solaris'``: Solaris threads | - +------------------+---------------------------------------------------------+ - | :attr:`!lock` | Name of the lock implementation: | - | | | - | | * ``'semaphore'``: a lock uses a semaphore | - | | * ``'mutex+cond'``: a lock uses a mutex | - | | and a condition variable | - | | * ``None`` if this information is unknown | - +------------------+---------------------------------------------------------+ - | :attr:`!version` | Name and version of the thread library. It is a string, | - | | or ``None`` if this information is unknown. | - +------------------+---------------------------------------------------------+ + .. attribute:: thread_info.name + + Name of the thread implementation: + + * ``"nt"``: Windows threads + * ``"pthread"``: POSIX threads + * ``"pthread-stubs"``: stub POSIX threads + (on WebAssembly platforms without threading support) + * ``"solaris"``: Solaris threads + + .. attribute:: thread_info.lock + + Name of the lock implementation: + + * ``"semaphore"``: a lock uses a semaphore + * ``"mutex+cond"``: a lock uses a mutex and a condition variable + * ``None`` if this information is unknown + + .. attribute:: thread_info.version + + Name and version of the thread library. + It is a string, or ``None`` if this information is unknown. .. versionadded:: 3.3 From c4ea1c2d4b398cec6e744c7c9d3cb1fdbad93414 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sat, 19 Aug 2023 14:34:44 +0200 Subject: [PATCH 4/8] The ... --- Doc/library/sys.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 9cd5c2d1ae3d23..a15bd01a2ff855 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1828,7 +1828,7 @@ always available. .. attribute:: thread_info.name - Name of the thread implementation: + The name of the thread implementation: * ``"nt"``: Windows threads * ``"pthread"``: POSIX threads @@ -1838,7 +1838,7 @@ always available. .. attribute:: thread_info.lock - Name of the lock implementation: + The name of the lock implementation: * ``"semaphore"``: a lock uses a semaphore * ``"mutex+cond"``: a lock uses a mutex and a condition variable @@ -1846,7 +1846,7 @@ always available. .. attribute:: thread_info.version - Name and version of the thread library. + The name and version of the thread library. It is a string, or ``None`` if this information is unknown. .. versionadded:: 3.3 From 973e32460c9cd8bf411c5931c0da7757908f91f5 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sat, 19 Aug 2023 15:28:21 +0200 Subject: [PATCH 5/8] Fix textwrap: 'placeholder' and 'width' should be marked up as params --- Doc/library/textwrap.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index a150eefbf932ef..e2952ce3cc2ca3 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -60,7 +60,7 @@ functions should be good enough; otherwise, you should use an instance of First the whitespace in *text* is collapsed (all whitespace is replaced by single spaces). If the result fits in the *width*, it is returned. Otherwise, enough words are dropped from the end so that the remaining words - plus the :attr:`.placeholder` fit within :attr:`.width`:: + plus the *placeholder* fit within *width*:: >>> textwrap.shorten("Hello world!", width=12) 'Hello world!' From 9540cdaac229f17dc4bb24e51779a3ef7711e6b8 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sat, 19 Aug 2023 18:54:50 +0200 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/library/sys.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a15bd01a2ff855..626608208e1c1e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1145,7 +1145,8 @@ always available. .. versionchanged:: 3.11 - Added :attr:`int_info.default_max_str_digits` and :attr:`int_info.str_digits_check_threshold`. + Added :attr:`~int_info.default_max_str_digits` and + :attr:`~int_info.str_digits_check_threshold`. .. data:: __interactivehook__ From 37dafb3b7b9a21be404dc55a9cfb9278d71aaa48 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sat, 19 Aug 2023 18:57:19 +0200 Subject: [PATCH 7/8] Trailing whitespace --- Doc/library/sys.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 626608208e1c1e..4f07ec477982a7 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1145,7 +1145,7 @@ always available. .. versionchanged:: 3.11 - Added :attr:`~int_info.default_max_str_digits` and + Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info.str_digits_check_threshold`. From a373c4003d7f12dffbc5be45c397f224b10d54d9 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 20 Aug 2023 11:27:09 +0200 Subject: [PATCH 8/8] Add more links to frame objects --- Doc/library/sys.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a15bd01a2ff855..0b4abda060c186 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1572,7 +1572,7 @@ always available. :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this works. Per-line events may be disabled for a frame by setting - :attr:`!f_trace_lines` to :const:`False` on that frame. + :attr:`!f_trace_lines` to :const:`False` on that :ref:`frame `. ``'return'`` A function (or other code block) is about to return. The local trace @@ -1591,7 +1591,7 @@ always available. ``None``; the return value specifies the new local trace function. Per-opcode events are not emitted by default: they must be explicitly requested by setting :attr:`!f_trace_opcodes` to :const:`True` on the - frame. + :ref:`frame `. Note that as an exception is propagated down the chain of callers, an ``'exception'`` event is generated at each level.