Skip to content

Commit 3c11738

Browse files
authored
pythonGH-121970: Remove Docutils list monkeypatch (python#142056)
1 parent cfcd524 commit 3c11738

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
@@ -2109,20 +2109,20 @@ to work with the :class:`Decimal` class::
21092109
Decimal FAQ
21102110
-----------
21112111

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

2115-
A. Some users abbreviate the constructor to just a single letter:
2115+
A: Some users abbreviate the constructor to just a single letter:
21162116

21172117
>>> D = decimal.Decimal
21182118
>>> D('1.23') + D('3.45')
21192119
Decimal('4.68')
21202120

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

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

21282128
>>> TWOPLACES = Decimal(10) ** -2 # same as Decimal('0.01')
@@ -2140,10 +2140,10 @@ the :const:`Inexact` trap is set, it is also useful for validation:
21402140
...
21412141
Inexact: None
21422142

2143-
Q. Once I have valid two place inputs, how do I maintain that invariant
2143+
Q: Once I have valid two place inputs, how do I maintain that invariant
21442144
throughout an application?
21452145

2146-
A. Some operations like addition, subtraction, and multiplication by an integer
2146+
A: Some operations like addition, subtraction, and multiplication by an integer
21472147
will automatically preserve fixed point. Others operations, like division and
21482148
non-integer multiplication, will change the number of decimal places and need to
21492149
be followed-up with a :meth:`~Decimal.quantize` step:
@@ -2175,21 +2175,21 @@ to handle the :meth:`~Decimal.quantize` step:
21752175
>>> div(b, a)
21762176
Decimal('0.03')
21772177

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

2183-
A. The :meth:`~Decimal.normalize` method maps all equivalent values to a single
2183+
A: The :meth:`~Decimal.normalize` method maps all equivalent values to a single
21842184
representative:
21852185

21862186
>>> values = map(Decimal, '200 200.000 2E2 .02E+4'.split())
21872187
>>> [v.normalize() for v in values]
21882188
[Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2'), Decimal('2E+2')]
21892189

2190-
Q. When does rounding occur in a computation?
2190+
Q: When does rounding occur in a computation?
21912191

2192-
A. It occurs *after* the computation. The philosophy of the decimal
2192+
A: It occurs *after* the computation. The philosophy of the decimal
21932193
specification is that numbers are considered exact and are created
21942194
independent of the current context. They can even have greater
21952195
precision than current context. Computations process with those
@@ -2207,10 +2207,10 @@ applied to the *result* of the computation::
22072207
>>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded
22082208
Decimal('3.1416')
22092209

2210-
Q. Some decimal values always print with exponential notation. Is there a way
2210+
Q: Some decimal values always print with exponential notation. Is there a way
22112211
to get a non-exponential representation?
22122212

2213-
A. For some values, exponential notation is the only way to express the number
2213+
A: For some values, exponential notation is the only way to express the number
22142214
of significant places in the coefficient. For example, expressing
22152215
``5.0E+3`` as ``5000`` keeps the value constant but cannot show the
22162216
original's two-place significance.
@@ -2225,9 +2225,9 @@ value unchanged:
22252225
>>> remove_exponent(Decimal('5E+3'))
22262226
Decimal('5000')
22272227

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

2230-
A. Yes, any binary floating-point number can be exactly expressed as a
2230+
A: Yes, any binary floating-point number can be exactly expressed as a
22312231
Decimal though an exact conversion may take more precision than intuition would
22322232
suggest:
22332233

@@ -2236,19 +2236,19 @@ suggest:
22362236
>>> Decimal(math.pi)
22372237
Decimal('3.141592653589793115997963468544185161590576171875')
22382238

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

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

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

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

2279-
Q. Is the CPython implementation fast for large numbers?
2279+
Q: Is the CPython implementation fast for large numbers?
22802280

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

29612961
:rfc:`RFC 4086: Randomness Requirements for Security <4086>`
2962-
Donald E., Jeffrey I. Schiller
2962+
Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker
29632963

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

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

29702970
:rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`
2971-
D. Eastlake
2971+
Donald E. Eastlake
29722972

29732973
`IANA TLS: Transport Layer Security (TLS) Parameters <https://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
29742974
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/main/%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)