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

Misc/NEWS.d/3.5.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,7 @@ module.
26482648
.. nonce: THJSYB
26492649
.. section: Library
26502650
2651-
Changed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
2651+
Changed FeedParser feed() to avoid O(N\ :sup:`2`) behavior when parsing long line.
26522652
Original patch by Raymond Hettinger.
26532653

26542654
..

Misc/NEWS.d/3.6.4rc1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
2222
Setting sys.tracebacklimit to None now causes using the default limit.
2323
Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
2424
the limit LONG_MAX rather than the default limit.
25-
Fixed integer overflows in the case of more than 2**31 traceback items on
25+
Fixed integer overflows in the case of more than ``2**31`` traceback items on
2626
Windows.
2727
Fixed output errors handling.
2828

Misc/NEWS.d/3.7.0a3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
100100
Setting sys.tracebacklimit to None now causes using the default limit.
101101
Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
102102
the limit LONG_MAX rather than the default limit.
103-
Fixed integer overflows in the case of more than 2**31 traceback items on
103+
Fixed integer overflows in the case of more than ``2**31`` traceback items on
104104
Windows.
105105
Fixed output errors handling.
106106

Misc/NEWS.d/3.8.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3355,7 +3355,7 @@ if the ``PATH`` environment variable is not set.
33553355
33563356
On Windows, fix multiprocessing.Connection for very large read: fix
33573357
_winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than INT_MAX
3358-
(usually 2^31-1).
3358+
(usually ``2**31-1``).
33593359

33603360
..
33613361

Misc/NEWS.d/3.9.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ objects. Patch by Dong-hee Na and Inada Naoki.
213213
.. section: Core and Builtins
214214
215215
:class:`bytearray`, :class:`~array.array` and :class:`~mmap.mmap` objects
216-
allow now to export more than 2**31 buffers at a time.
216+
allow now to export more than ``2**31`` buffers at a time.
217217

218218
..
219219
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fixed pickling of range iterators that iterated for over 2**32 times.
1+
Fixed pickling of range iterators that iterated for over ``2**32`` times.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Improve accuracy of variance calculations by using x*x instead of x**2.
1+
Improve accuracy of variance calculations by using ``x*x`` instead of ``x**2``.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
On Windows, :func:`time.sleep` now uses a waitable timer which has a resolution
2-
of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms (10^-3 sec).
2+
of 100 ns (10\ :sup:`-7` sec). Previously, it had a solution of 1 ms (10\ :sup:`-3` sec).
33
Patch by Livius and Victor Stinner.

0 commit comments

Comments
 (0)