Skip to content

Commit 612213c

Browse files
[3.14] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142088)
1 parent fed2af6 commit 612213c

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
@@ -2100,20 +2100,20 @@ to work with the :class:`Decimal` class::
21002100
Decimal FAQ
21012101
-----------
21022102

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

2106-
A. Some users abbreviate the constructor to just a single letter:
2106+
A: Some users abbreviate the constructor to just a single letter:
21072107

21082108
>>> D = decimal.Decimal
21092109
>>> D('1.23') + D('3.45')
21102110
Decimal('4.68')
21112111

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

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

21192119
>>> TWOPLACES = Decimal(10) ** -2 # same as Decimal('0.01')
@@ -2131,10 +2131,10 @@ the :const:`Inexact` trap is set, it is also useful for validation:
21312131
...
21322132
Inexact: None
21332133

2134-
Q. Once I have valid two place inputs, how do I maintain that invariant
2134+
Q: Once I have valid two place inputs, how do I maintain that invariant
21352135
throughout an application?
21362136

2137-
A. Some operations like addition, subtraction, and multiplication by an integer
2137+
A: Some operations like addition, subtraction, and multiplication by an integer
21382138
will automatically preserve fixed point. Others operations, like division and
21392139
non-integer multiplication, will change the number of decimal places and need to
21402140
be followed-up with a :meth:`~Decimal.quantize` step:
@@ -2166,21 +2166,21 @@ to handle the :meth:`~Decimal.quantize` step:
21662166
>>> div(b, a)
21672167
Decimal('0.03')
21682168

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

2174-
A. The :meth:`~Decimal.normalize` method maps all equivalent values to a single
2174+
A: The :meth:`~Decimal.normalize` method maps all equivalent values to a single
21752175
representative:
21762176

21772177
>>> values = map(Decimal, '200 200.000 2E2 .02E+4'.split())
21782178
>>> [v.normalize() for v in values]
21792179
[Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2')]
21802180

2181-
Q. When does rounding occur in a computation?
2181+
Q: When does rounding occur in a computation?
21822182

2183-
A. It occurs *after* the computation. The philosophy of the decimal
2183+
A: It occurs *after* the computation. The philosophy of the decimal
21842184
specification is that numbers are considered exact and are created
21852185
independent of the current context. They can even have greater
21862186
precision than current context. Computations process with those
@@ -2198,10 +2198,10 @@ applied to the *result* of the computation::
21982198
>>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded
21992199
Decimal('3.1416')
22002200

2201-
Q. Some decimal values always print with exponential notation. Is there a way
2201+
Q: Some decimal values always print with exponential notation. Is there a way
22022202
to get a non-exponential representation?
22032203

2204-
A. For some values, exponential notation is the only way to express the number
2204+
A: For some values, exponential notation is the only way to express the number
22052205
of significant places in the coefficient. For example, expressing
22062206
``5.0E+3`` as ``5000`` keeps the value constant but cannot show the
22072207
original's two-place significance.
@@ -2216,9 +2216,9 @@ value unchanged:
22162216
>>> remove_exponent(Decimal('5E+3'))
22172217
Decimal('5000')
22182218

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

2221-
A. Yes, any binary floating-point number can be exactly expressed as a
2221+
A: Yes, any binary floating-point number can be exactly expressed as a
22222222
Decimal though an exact conversion may take more precision than intuition would
22232223
suggest:
22242224

@@ -2227,19 +2227,19 @@ suggest:
22272227
>>> Decimal(math.pi)
22282228
Decimal('3.141592653589793115997963468544185161590576171875')
22292229

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

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

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

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

2270-
Q. Is the CPython implementation fast for large numbers?
2270+
Q: Is the CPython implementation fast for large numbers?
22712271

2272-
A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of
2272+
A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of
22732273
the decimal module integrate the high speed `libmpdec
22742274
<https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html>`_ library for
22752275
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
@@ -2825,16 +2825,16 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available.
28252825
Steve Kent
28262826

28272827
:rfc:`RFC 4086: Randomness Requirements for Security <4086>`
2828-
Donald E., Jeffrey I. Schiller
2828+
Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker
28292829

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

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

28362836
:rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`
2837-
D. Eastlake
2837+
Donald E. Eastlake
28382838

28392839
`IANA TLS: Transport Layer Security (TLS) Parameters <https://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
28402840
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.14/%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 <rdmurray@bitdance.com> (Editor)
5+
:Author: \R. David Murray <rdmurray@bitdance.com> (Editor)
66

77
.. Rules for maintenance:
88

0 commit comments

Comments
 (0)