Skip to content

Commit 342c9e0

Browse files
[3.13] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142089)
1 parent 99b70fe commit 342c9e0

File tree

5 files changed

+26
-34
lines changed

5 files changed

+26
-34
lines changed

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Functional Programming HOWTO
55
********************************
66

7-
:Author: A. M. Kuchling
7+
:Author: \A. M. Kuchling
88
:Release: 0.32
99

1010
In this document, we'll take a tour of Python's features suitable for

Doc/library/decimal.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,20 +2067,20 @@ to work with the :class:`Decimal` class::
20672067
Decimal FAQ
20682068
-----------
20692069

2070-
Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way to
2070+
Q: It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way to
20712071
minimize typing when using the interactive interpreter?
20722072

2073-
A. Some users abbreviate the constructor to just a single letter:
2073+
A: Some users abbreviate the constructor to just a single letter:
20742074

20752075
>>> D = decimal.Decimal
20762076
>>> D('1.23') + D('3.45')
20772077
Decimal('4.68')
20782078

2079-
Q. In a fixed-point application with two decimal places, some inputs have many
2079+
Q: In a fixed-point application with two decimal places, some inputs have many
20802080
places and need to be rounded. Others are not supposed to have excess digits
20812081
and need to be validated. What methods should be used?
20822082

2083-
A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal places. If
2083+
A: The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal places. If
20842084
the :const:`Inexact` trap is set, it is also useful for validation:
20852085

20862086
>>> TWOPLACES = Decimal(10) ** -2 # same as Decimal('0.01')
@@ -2098,10 +2098,10 @@ the :const:`Inexact` trap is set, it is also useful for validation:
20982098
...
20992099
Inexact: None
21002100

2101-
Q. Once I have valid two place inputs, how do I maintain that invariant
2101+
Q: Once I have valid two place inputs, how do I maintain that invariant
21022102
throughout an application?
21032103

2104-
A. Some operations like addition, subtraction, and multiplication by an integer
2104+
A: Some operations like addition, subtraction, and multiplication by an integer
21052105
will automatically preserve fixed point. Others operations, like division and
21062106
non-integer multiplication, will change the number of decimal places and need to
21072107
be followed-up with a :meth:`~Decimal.quantize` step:
@@ -2133,21 +2133,21 @@ to handle the :meth:`~Decimal.quantize` step:
21332133
>>> div(b, a)
21342134
Decimal('0.03')
21352135

2136-
Q. There are many ways to express the same value. The numbers ``200``,
2136+
Q: There are many ways to express the same value. The numbers ``200``,
21372137
``200.000``, ``2E2``, and ``.02E+4`` all have the same value at
21382138
various precisions. Is there a way to transform them to a single recognizable
21392139
canonical value?
21402140

2141-
A. The :meth:`~Decimal.normalize` method maps all equivalent values to a single
2141+
A: The :meth:`~Decimal.normalize` method maps all equivalent values to a single
21422142
representative:
21432143

21442144
>>> values = map(Decimal, '200 200.000 2E2 .02E+4'.split())
21452145
>>> [v.normalize() for v in values]
21462146
[Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2')]
21472147

2148-
Q. When does rounding occur in a computation?
2148+
Q: When does rounding occur in a computation?
21492149

2150-
A. It occurs *after* the computation. The philosophy of the decimal
2150+
A: It occurs *after* the computation. The philosophy of the decimal
21512151
specification is that numbers are considered exact and are created
21522152
independent of the current context. They can even have greater
21532153
precision than current context. Computations process with those
@@ -2165,10 +2165,10 @@ applied to the *result* of the computation::
21652165
>>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded
21662166
Decimal('3.1416')
21672167

2168-
Q. Some decimal values always print with exponential notation. Is there a way
2168+
Q: Some decimal values always print with exponential notation. Is there a way
21692169
to get a non-exponential representation?
21702170

2171-
A. For some values, exponential notation is the only way to express the number
2171+
A: For some values, exponential notation is the only way to express the number
21722172
of significant places in the coefficient. For example, expressing
21732173
``5.0E+3`` as ``5000`` keeps the value constant but cannot show the
21742174
original's two-place significance.
@@ -2183,9 +2183,9 @@ value unchanged:
21832183
>>> remove_exponent(Decimal('5E+3'))
21842184
Decimal('5000')
21852185

2186-
Q. Is there a way to convert a regular float to a :class:`Decimal`?
2186+
Q: Is there a way to convert a regular float to a :class:`Decimal`?
21872187

2188-
A. Yes, any binary floating-point number can be exactly expressed as a
2188+
A: Yes, any binary floating-point number can be exactly expressed as a
21892189
Decimal though an exact conversion may take more precision than intuition would
21902190
suggest:
21912191

@@ -2194,19 +2194,19 @@ suggest:
21942194
>>> Decimal(math.pi)
21952195
Decimal('3.141592653589793115997963468544185161590576171875')
21962196

2197-
Q. Within a complex calculation, how can I make sure that I haven't gotten a
2197+
Q: Within a complex calculation, how can I make sure that I haven't gotten a
21982198
spurious result because of insufficient precision or rounding anomalies.
21992199

2200-
A. The decimal module makes it easy to test results. A best practice is to
2200+
A: The decimal module makes it easy to test results. A best practice is to
22012201
re-run calculations using greater precision and with various rounding modes.
22022202
Widely differing results indicate insufficient precision, rounding mode issues,
22032203
ill-conditioned inputs, or a numerically unstable algorithm.
22042204

2205-
Q. I noticed that context precision is applied to the results of operations but
2205+
Q: I noticed that context precision is applied to the results of operations but
22062206
not to the inputs. Is there anything to watch out for when mixing values of
22072207
different precisions?
22082208

2209-
A. Yes. The principle is that all values are considered to be exact and so is
2209+
A: Yes. The principle is that all values are considered to be exact and so is
22102210
the arithmetic on those values. Only the results are rounded. The advantage
22112211
for inputs is that "what you type is what you get". A disadvantage is that the
22122212
results can look odd if you forget that the inputs haven't been rounded:
@@ -2234,9 +2234,9 @@ Alternatively, inputs can be rounded upon creation using the
22342234
>>> Context(prec=5, rounding=ROUND_DOWN).create_decimal('1.2345678')
22352235
Decimal('1.2345')
22362236

2237-
Q. Is the CPython implementation fast for large numbers?
2237+
Q: Is the CPython implementation fast for large numbers?
22382238

2239-
A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of
2239+
A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of
22402240
the decimal module integrate the high speed `libmpdec
22412241
<https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html>`_ library for
22422242
arbitrary precision correctly rounded decimal floating-point arithmetic [#]_.

Doc/library/ssl.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,16 +2818,16 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available.
28182818
Steve Kent
28192819

28202820
:rfc:`RFC 4086: Randomness Requirements for Security <4086>`
2821-
Donald E., Jeffrey I. Schiller
2821+
Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker
28222822

28232823
:rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile <5280>`
2824-
D. Cooper
2824+
David Cooper et al.
28252825

28262826
:rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 <5246>`
2827-
T. Dierks et. al.
2827+
Tim Dierks and Eric Rescorla.
28282828

28292829
:rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`
2830-
D. Eastlake
2830+
Donald E. Eastlake
28312831

28322832
`IANA TLS: Transport Layer Security (TLS) Parameters <https://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
28332833
IANA

Doc/tools/extensions/pyspecific.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
# Used in conf.py and updated here by python/release-tools/run_release.py
2525
SOURCE_URI = 'https://github.com/python/cpython/tree/3.13/%s'
2626

27-
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
28-
from docutils.parsers.rst.states import Body
29-
Body.enum.converters['loweralpha'] = \
30-
Body.enum.converters['upperalpha'] = \
31-
Body.enum.converters['lowerroman'] = \
32-
Body.enum.converters['upperroman'] = lambda x: None
33-
34-
3527
class PyAwaitableMixin(object):
3628
def handle_signature(self, sig, signode):
3729
ret = super(PyAwaitableMixin, self).handle_signature(sig, signode)

Doc/whatsnew/3.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
What's New In Python 3.4
33
****************************
44

5-
:Author: R. David Murray <[email protected]> (Editor)
5+
:Author: \R. David Murray <[email protected]> (Editor)
66

77
.. Rules for maintenance:
88

0 commit comments

Comments
 (0)