]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[docs] Improve the markup of powers (GH-28598)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 28 Sep 2021 20:40:57 +0000 (23:40 +0300)
committerGitHub <noreply@github.com>
Tue, 28 Sep 2021 20:40:57 +0000 (22:40 +0200)
18 files changed:
Doc/library/functions.rst
Doc/library/hashlib.rst
Doc/library/ipaddress.rst
Doc/library/plistlib.rst
Doc/reference/datamodel.rst
Doc/using/cmdline.rst
Doc/whatsnew/2.0.rst
Doc/whatsnew/2.7.rst
Doc/whatsnew/3.1.rst
Doc/whatsnew/3.11.rst
Misc/NEWS.d/3.5.0a1.rst
Misc/NEWS.d/3.6.4rc1.rst
Misc/NEWS.d/3.7.0a3.rst
Misc/NEWS.d/3.8.0a1.rst
Misc/NEWS.d/3.9.0a1.rst
Misc/NEWS.d/next/Core and Builtins/2021-08-26-18-44-03.bpo-45018.pu8H9L.rst
Misc/NEWS.d/next/Library/2021-08-25-20-18-31.bpo-39218.BlO6jW.rst
Misc/NEWS.d/next/Library/2021-09-20-22-46-40.bpo-21302.h56430.rst

index 19d67e9d754c2cd9a4999437f9cefedb4733299f..a651d8829cd29ce8f20c511ed1d46a547cf2ca03 100644 (file)
@@ -1345,8 +1345,8 @@ are always available.  They are listed here in alphabetical order.
    coercion rules for binary arithmetic operators apply.  For :class:`int`
    operands, the result has the same type as the operands (after coercion)
    unless the second argument is negative; in that case, all arguments are
-   converted to float and a float result is delivered.  For example, ``10**2``
-   returns ``100``, but ``10**-2`` returns ``0.01``.
+   converted to float and a float result is delivered.  For example, ``pow(10, 2)``
+   returns ``100``, but ``pow(10, -2)`` returns ``0.01``.
 
    For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must
    also be of integer type and *mod* must be nonzero. If *mod* is present and
index 37addee6cda809c9aad83d77b06cc9a473d071f8..77b35fd1d766c8fd558319edc148b26cceb0bd41 100644 (file)
@@ -376,10 +376,10 @@ Constructor functions also accept the following tree hashing parameters:
 * *depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in
   sequential mode).
 
-* *leaf_size*: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in
+* *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in
   sequential mode).
 
-* *node_offset*: node offset (0 to 2**64-1 for BLAKE2b, 0 to 2**48-1 for
+* *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for
   BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).
 
 * *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode).
index 2ab4dd83ad4deefff26e3f5b40c6fdf6bb7d42c1..74d922d29db69ce8284f3799684efb8c4ed15ff3 100644 (file)
@@ -41,7 +41,7 @@ IP addresses, networks and interfaces:
 
    Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on
    the IP address passed as argument.  Either IPv4 or IPv6 addresses may be
-   supplied; integers less than 2**32 will be considered to be IPv4 by default.
+   supplied; integers less than ``2**32`` will be considered to be IPv4 by default.
    A :exc:`ValueError` is raised if *address* does not represent a valid IPv4
    or IPv6 address.
 
@@ -56,7 +56,7 @@ IP addresses, networks and interfaces:
    Return an :class:`IPv4Network` or :class:`IPv6Network` object depending on
    the IP address passed as argument.  *address* is a string or integer
    representing the IP network.  Either IPv4 or IPv6 networks may be supplied;
-   integers less than 2**32 will be considered to be IPv4 by default.  *strict*
+   integers less than ``2**32`` will be considered to be IPv4 by default.  *strict*
    is passed to :class:`IPv4Network` or :class:`IPv6Network` constructor.  A
    :exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
    IPv6 address, or if the network has host bits set.
@@ -70,7 +70,7 @@ IP addresses, networks and interfaces:
    Return an :class:`IPv4Interface` or :class:`IPv6Interface` object depending
    on the IP address passed as argument.  *address* is a string or integer
    representing the IP address.  Either IPv4 or IPv6 addresses may be supplied;
-   integers less than 2**32 will be considered to be IPv4 by default.  A
+   integers less than ``2**32`` will be considered to be IPv4 by default.  A
    :exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
    IPv6 address.
 
index ce6d4a85bf5e9d2668d3afd92219de729360acb9..5ded9661f080143e0390f699ad9a390a13f0d0bd 100644 (file)
@@ -133,7 +133,7 @@ The following classes are available:
    encoded data, which contains UID (see PList manual).
 
    It has one attribute, :attr:`data`, which can be used to retrieve the int value
-   of the UID.  :attr:`data` must be in the range `0 <= data < 2**64`.
+   of the UID.  :attr:`data` must be in the range ``0 <= data < 2**64``.
 
    .. versionadded:: 3.8
 
index 181e445bb7bc6e9b2385b02423116098d1a41ceb..f1334f047d4b737f68e066a77d7c2c58fc5fe8bd 100644 (file)
@@ -1558,7 +1558,7 @@ Basic customization
 
       This is intended to provide protection against a denial-of-service caused
       by carefully-chosen inputs that exploit the worst case performance of a
-      dict insertion, O(n^2) complexity.  See
+      dict insertion, O(n\ :sup:`2`) complexity.  See
       http://www.ocert.org/advisories/ocert-2011-003.html for details.
 
       Changing hash values affects the iteration order of sets.
index a9c0931363bfcab15238a74ad9835a277b0c77b9..b42518e8731ca8b7887523a9160cbc9ef1c4d418 100644 (file)
@@ -322,7 +322,7 @@ Miscellaneous options
 
    Hash randomization is intended to provide protection against a
    denial-of-service caused by carefully-chosen inputs that exploit the worst
-   case performance of a dict construction, O(n^2) complexity.  See
+   case performance of a dict construction, O(n\ :sup:`2`) complexity.  See
    http://www.ocert.org/advisories/ocert-2011-003.html for details.
 
    :envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash
index c0a6692049788b716b7e3033b4e676263116699c..0e1cf1fd0ce46c17f4010d3bea47f2a8b7599aea 100644 (file)
@@ -791,7 +791,7 @@ Previously the Python virtual machine used 16-bit numbers in its bytecode,
 limiting the size of source files.  In particular, this affected the maximum
 size of literal lists and dictionaries in Python source; occasionally people who
 are generating Python code would run into this limit.  A patch by Charles G.
-Waldman raises the limit from ``2^16`` to ``2^{32}``.
+Waldman raises the limit from ``2**16`` to ``2**32``.
 
 Three new convenience functions intended for adding constants to a module's
 dictionary at module initialization time were added: :func:`PyModule_AddObject`,
index d19c8e01ad8a00e57a8d3de067af19e528472f27..abb65222ddd3d03d5a364230edc0342b08cfcb53 100644 (file)
@@ -953,12 +953,12 @@ Several performance enhancements have been added:
   considered and traversed by the collector.
   (Contributed by Antoine Pitrou; :issue:`4688`.)
 
-* Long integers are now stored internally either in base 2**15 or in base
-  2**30, the base being determined at build time.  Previously, they
-  were always stored in base 2**15.  Using base 2**30 gives
+* Long integers are now stored internally either in base ``2**15`` or in base
+  ``2**30``, the base being determined at build time.  Previously, they
+  were always stored in base ``2**15``.  Using base ``2**30`` gives
   significant performance improvements on 64-bit machines, but
   benchmark results on 32-bit machines have been mixed.  Therefore,
-  the default is to use base 2**30 on 64-bit machines and base 2**15
+  the default is to use base ``2**30`` on 64-bit machines and base ``2**15``
   on 32-bit machines; on Unix, there's a new configure option
   :option:`!--enable-big-digits` that can be used to override this default.
 
index 919fbeeb2ad85783336613fa9ead33df2c360224..f1e6d0c4f3dd685f44c901a6aad43714fbbb3b96 100644 (file)
@@ -474,12 +474,12 @@ Build and C API Changes
 
 Changes to Python's build process and to the C API include:
 
-* Integers are now stored internally either in base 2**15 or in base
-  2**30, the base being determined at build time.  Previously, they
-  were always stored in base 2**15.  Using base 2**30 gives
+* Integers are now stored internally either in base ``2**15`` or in base
+  ``2**30``, the base being determined at build time.  Previously, they
+  were always stored in base ``2**15``.  Using base ``2**30`` gives
   significant performance improvements on 64-bit machines, but
   benchmark results on 32-bit machines have been mixed.  Therefore,
-  the default is to use base 2**30 on 64-bit machines and base 2**15
+  the default is to use base ``2**30`` on 64-bit machines and base ``2**15``
   on 32-bit machines; on Unix, there's a new configure option
   ``--enable-big-digits`` that can be used to override this default.
 
index 7121bbe35310d6742f6dfe1864c4d90168bbdf94..484aad7d657628821230355238fe73631584085b 100644 (file)
@@ -243,14 +243,14 @@ time
 ----
 
 * On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or
-  ``nanosleep()`` function, if available, which has a resolution of 1 ns (10^-9
-  sec), rather than using ``select()`` which has a resolution of 1 us (10^-6
-  sec).
+  ``nanosleep()`` function, if available, which has a resolution of 1 ns
+  (10\ :sup:`-9` sec), rather than using ``select()`` which has a resolution
+  of 1 us (10\ :sup:`-6` sec).
   (Contributed by Livius and Victor Stinner in :issue:`21302`.)
 
 * On Windows, :func:`time.sleep` now uses a waitable timer which has a
-  resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms
-  (10^-3 sec).
+  resolution of 100 ns (10\ :sup:`-7` sec). Previously, it had a solution of 1 ms
+  (10\ :sup:`-3` sec).
   (Contributed by Livius and Victor Stinner in :issue:`21302`.)
 
 unicodedata
index a9eba80f5f9670eaecd9fb26a00c3ac541e71bd0..97bdef6c93213f4f65f1147b4faf41de06657eec 100644 (file)
@@ -2648,7 +2648,7 @@ module.
 .. nonce: THJSYB
 .. section: Library
 
-Changed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
+Changed FeedParser feed() to avoid O(N\ :sup:`2`) behavior when parsing long line.
 Original patch by Raymond Hettinger.
 
 ..
index 36dfadda0fe1b397d9e8622c27a3805721003aa0..dc9ab7ad56de8976ee8cd4fc93df2d47af876542 100644 (file)
@@ -22,7 +22,7 @@ Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
 Setting sys.tracebacklimit to None now causes using the default limit.
 Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
 the limit LONG_MAX rather than the default limit.
-Fixed integer overflows in the case of more than 2**31 traceback items on
+Fixed integer overflows in the case of more than ``2**31`` traceback items on
 Windows.
 Fixed output errors handling.
 
index 8ef7a5118a1f55839f91597c68fe8b4cc40c2d9e..067720efa516e0633a796cf5fd558bc7a6c7a2fb 100644 (file)
@@ -100,7 +100,7 @@ Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
 Setting sys.tracebacklimit to None now causes using the default limit.
 Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
 the limit LONG_MAX rather than the default limit.
-Fixed integer overflows in the case of more than 2**31 traceback items on
+Fixed integer overflows in the case of more than ``2**31`` traceback items on
 Windows.
 Fixed output errors handling.
 
index 89811c12a7948e57ea11b85e2e064abe6b34fa67..5cd3fa32105c274b8de4d40e17942b9b6faa588f 100644 (file)
@@ -3355,7 +3355,7 @@ if the ``PATH`` environment variable is not set.
 
 On Windows, fix multiprocessing.Connection for very large read: fix
 _winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than INT_MAX
-(usually 2^31-1).
+(usually ``2**31-1``).
 
 ..
 
index fe9fc58e3979ae71fe401f5047d74d6337b1ef7e..0a6a6eb287145900f117dae623fdfa406651a205 100644 (file)
@@ -213,7 +213,7 @@ objects. Patch by Dong-hee Na and Inada Naoki.
 .. section: Core and Builtins
 
 :class:`bytearray`, :class:`~array.array` and :class:`~mmap.mmap` objects
-allow now to export more than 2**31 buffers at a time.
+allow now to export more than ``2**31`` buffers at a time.
 
 ..
 
index 5bf13ef06f34c3f6d5b132c96e43deb1ba696bd4..88ef80630ef9b3d8515eee9ced24c7cc067865a9 100644 (file)
@@ -1 +1 @@
-Fixed pickling of range iterators that iterated for over 2**32 times.
+Fixed pickling of range iterators that iterated for over ``2**32`` times.
index 7bcf9a222e33c379ebb7f7101b0bd6f83a578437..f45dbfe463c87e65b1344c305a98bb17967348ab 100644 (file)
@@ -1 +1 @@
-Improve accuracy of variance calculations by using x*x instead of x**2.
+Improve accuracy of variance calculations by using ``x*x`` instead of ``x**2``.
index 22011b791e5f2ddc4becb4fed629016a446a5c04..1746d56f41b4c0eb9da64e7c83b743ac0fbee015 100644 (file)
@@ -1,3 +1,3 @@
 On Windows, :func:`time.sleep` now uses a waitable timer which has a resolution
-of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms (10^-3 sec).
+of 100 ns (10\ :sup:`-7` sec). Previously, it had a solution of 1 ms (10\ :sup:`-3` sec).
 Patch by Livius and Victor Stinner.