Skip to content

Commit 4f05f15

Browse files
[docs] Improve the markup of powers (GH-28598)
1 parent 0c50b8c commit 4f05f15

18 files changed

+32
-32
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,8 @@ are always available. They are listed here in alphabetical order.
13451345
coercion rules for binary arithmetic operators apply. For :class:`int`
13461346
operands, the result has the same type as the operands (after coercion)
13471347
unless the second argument is negative; in that case, all arguments are
1348-
converted to float and a float result is delivered. For example, ``10**2``
1349-
returns ``100``, but ``10**-2`` returns ``0.01``.
1348+
converted to float and a float result is delivered. For example, ``pow(10, 2)``
1349+
returns ``100``, but ``pow(10, -2)`` returns ``0.01``.
13501350

13511351
For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must
13521352
also be of integer type and *mod* must be nonzero. If *mod* is present and

Doc/library/hashlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,10 @@ Constructor functions also accept the following tree hashing parameters:
376376
* *depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in
377377
sequential mode).
378378

379-
* *leaf_size*: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in
379+
* *leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in
380380
sequential mode).
381381

382-
* *node_offset*: node offset (0 to 2**64-1 for BLAKE2b, 0 to 2**48-1 for
382+
* *node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for
383383
BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).
384384

385385
* *node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode).

Doc/library/ipaddress.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ IP addresses, networks and interfaces:
4141

4242
Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on
4343
the IP address passed as argument. Either IPv4 or IPv6 addresses may be
44-
supplied; integers less than 2**32 will be considered to be IPv4 by default.
44+
supplied; integers less than ``2**32`` will be considered to be IPv4 by default.
4545
A :exc:`ValueError` is raised if *address* does not represent a valid IPv4
4646
or IPv6 address.
4747

@@ -56,7 +56,7 @@ IP addresses, networks and interfaces:
5656
Return an :class:`IPv4Network` or :class:`IPv6Network` object depending on
5757
the IP address passed as argument. *address* is a string or integer
5858
representing the IP network. Either IPv4 or IPv6 networks may be supplied;
59-
integers less than 2**32 will be considered to be IPv4 by default. *strict*
59+
integers less than ``2**32`` will be considered to be IPv4 by default. *strict*
6060
is passed to :class:`IPv4Network` or :class:`IPv6Network` constructor. A
6161
:exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
6262
IPv6 address, or if the network has host bits set.
@@ -70,7 +70,7 @@ IP addresses, networks and interfaces:
7070
Return an :class:`IPv4Interface` or :class:`IPv6Interface` object depending
7171
on the IP address passed as argument. *address* is a string or integer
7272
representing the IP address. Either IPv4 or IPv6 addresses may be supplied;
73-
integers less than 2**32 will be considered to be IPv4 by default. A
73+
integers less than ``2**32`` will be considered to be IPv4 by default. A
7474
:exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
7575
IPv6 address.
7676

Doc/library/plistlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The following classes are available:
133133
encoded data, which contains UID (see PList manual).
134134

135135
It has one attribute, :attr:`data`, which can be used to retrieve the int value
136-
of the UID. :attr:`data` must be in the range `0 <= data < 2**64`.
136+
of the UID. :attr:`data` must be in the range ``0 <= data < 2**64``.
137137

138138
.. versionadded:: 3.8
139139

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ Basic customization
15581558

15591559
This is intended to provide protection against a denial-of-service caused
15601560
by carefully-chosen inputs that exploit the worst case performance of a
1561-
dict insertion, O(n^2) complexity. See
1561+
dict insertion, O(n\ :sup:`2`) complexity. See
15621562
http://www.ocert.org/advisories/ocert-2011-003.html for details.
15631563

15641564
Changing hash values affects the iteration order of sets.

Doc/using/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Miscellaneous options
322322

323323
Hash randomization is intended to provide protection against a
324324
denial-of-service caused by carefully-chosen inputs that exploit the worst
325-
case performance of a dict construction, O(n^2) complexity. See
325+
case performance of a dict construction, O(n\ :sup:`2`) complexity. See
326326
http://www.ocert.org/advisories/ocert-2011-003.html for details.
327327

328328
:envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash

Doc/whatsnew/2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ Previously the Python virtual machine used 16-bit numbers in its bytecode,
791791
limiting the size of source files. In particular, this affected the maximum
792792
size of literal lists and dictionaries in Python source; occasionally people who
793793
are generating Python code would run into this limit. A patch by Charles G.
794-
Waldman raises the limit from ``2^16`` to ``2^{32}``.
794+
Waldman raises the limit from ``2**16`` to ``2**32``.
795795

796796
Three new convenience functions intended for adding constants to a module's
797797
dictionary at module initialization time were added: :func:`PyModule_AddObject`,

Doc/whatsnew/2.7.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,12 +953,12 @@ Several performance enhancements have been added:
953953
considered and traversed by the collector.
954954
(Contributed by Antoine Pitrou; :issue:`4688`.)
955955

956-
* Long integers are now stored internally either in base 2**15 or in base
957-
2**30, the base being determined at build time. Previously, they
958-
were always stored in base 2**15. Using base 2**30 gives
956+
* Long integers are now stored internally either in base ``2**15`` or in base
957+
``2**30``, the base being determined at build time. Previously, they
958+
were always stored in base ``2**15``. Using base ``2**30`` gives
959959
significant performance improvements on 64-bit machines, but
960960
benchmark results on 32-bit machines have been mixed. Therefore,
961-
the default is to use base 2**30 on 64-bit machines and base 2**15
961+
the default is to use base ``2**30`` on 64-bit machines and base ``2**15``
962962
on 32-bit machines; on Unix, there's a new configure option
963963
:option:`!--enable-big-digits` that can be used to override this default.
964964

Doc/whatsnew/3.1.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,12 @@ Build and C API Changes
474474

475475
Changes to Python's build process and to the C API include:
476476

477-
* Integers are now stored internally either in base 2**15 or in base
478-
2**30, the base being determined at build time. Previously, they
479-
were always stored in base 2**15. Using base 2**30 gives
477+
* Integers are now stored internally either in base ``2**15`` or in base
478+
``2**30``, the base being determined at build time. Previously, they
479+
were always stored in base ``2**15``. Using base ``2**30`` gives
480480
significant performance improvements on 64-bit machines, but
481481
benchmark results on 32-bit machines have been mixed. Therefore,
482-
the default is to use base 2**30 on 64-bit machines and base 2**15
482+
the default is to use base ``2**30`` on 64-bit machines and base ``2**15``
483483
on 32-bit machines; on Unix, there's a new configure option
484484
``--enable-big-digits`` that can be used to override this default.
485485

Doc/whatsnew/3.11.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ time
243243
----
244244

245245
* On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or
246-
``nanosleep()`` function, if available, which has a resolution of 1 ns (10^-9
247-
sec), rather than using ``select()`` which has a resolution of 1 us (10^-6
248-
sec).
246+
``nanosleep()`` function, if available, which has a resolution of 1 ns
247+
(10\ :sup:`-9` sec), rather than using ``select()`` which has a resolution
248+
of 1 us (10\ :sup:`-6` sec).
249249
(Contributed by Livius and Victor Stinner in :issue:`21302`.)
250250

251251
* On Windows, :func:`time.sleep` now uses a waitable timer which has a
252-
resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms
253-
(10^-3 sec).
252+
resolution of 100 ns (10\ :sup:`-7` sec). Previously, it had a solution of 1 ms
253+
(10\ :sup:`-3` sec).
254254
(Contributed by Livius and Victor Stinner in :issue:`21302`.)
255255

256256
unicodedata

0 commit comments

Comments
 (0)