Skip to content

Commit 1013832

Browse files
skirpichevhoodmaneefimov-mikhail
authored
Apply suggestions from code review
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com> Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
1 parent b5ff41b commit 1013832

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

peps/pep-0791.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ when explicitly noted otherwise, all return values are floats." This is no
3434
longer true: *None* of the functions listed in the `Number-theoretic
3535
functions <https://docs.python.org/3.14/library/math.html#number-theoretic-functions>`_
3636
subsection of the documentation returns a float, but the
37-
documentation doesn't say so. In the proposed module a similar sentence "All
38-
return values are integers." could tell the truth once. In a similar way we
37+
documentation doesn't say so. In the documentation for the proposed ``imath`` module the sentence "All
38+
return values are integers." would be accurate. In a similar way we
3939
can simplify the description of the accepted arguments for functions in both the
4040
:external+py3.14:mod:`math` and the new module.
4141

42-
Apparently, the :external+py3.14:mod:`math` can't serve as a catch-all place
42+
Apparently, the :external+py3.14:mod:`math` module can't serve as a catch-all place
4343
for mathematical functions: we have also the :external+py3.14:mod:`cmath` and
44-
the :external+py3.14:mod:`statistics`. Let's do the same for integer-related
45-
functions. It would provide shared context, which reduces verbosity in the
44+
:external+py3.14:mod:`statistics` modules. Let's do the same for integer-related
45+
functions. It provides shared context, which reduces verbosity in the
4646
documentation and conceptual load. It also aids discoverability through
47-
grouping related functions and IDEs suggesting helpful completions.
47+
grouping related functions and makes IDE suggestions more helpful.
4848

4949

5050
Specification
5151
=============
5252

53-
The PEP proposes moving the following integer-related functions in a new
53+
The PEP proposes moving the following integer-related functions to a new
5454
module, called ``imath``:
5555

5656
* :external+py3.14:func:`~math.comb`
@@ -63,11 +63,11 @@ module, called ``imath``:
6363
Their aliases in :external+py3.14:mod:`math` will be :term:`soft deprecated`.
6464

6565
Module functions will accept integers and objects that implement the
66-
:external+py3.14:meth:`~object.__index__` method which is used to convert the
66+
:external+py3.14:meth:`~object.__index__` method, which is used to convert the
6767
object to an integer number.
6868

6969
Possible extensions for the new module and its scope are discussed in the
70-
`Open Issues <Open Issues_>`_ section. New functions are not part of the
70+
`Open Issues <Open Issues_>`_ section. New functions are not part of this
7171
proposal.
7272

7373

@@ -90,7 +90,7 @@ Open Issues
9090
Module name
9191
-----------
9292

93-
Chosen name seems consistent with other domain-specific mathematical module:
93+
The chosen name seems consistent with one existing domain-specific mathematical module:
9494
:external+py3.14:mod:`cmath` (for complex numbers).
9595

9696
There is already an ``imath`` project on PyPI, but only with two releases, with
@@ -100,7 +100,7 @@ include Python bindings with the same name.
100100

101101
`Polling shows <https://discuss.python.org/t/91337/35>`_ ``intmath`` as another
102102
popular name. The argument made was that the normal mathematical spelling of
103-
the imaginary unit is ``i``, which makes imath ambiguous. It also has no conflict
103+
the imaginary unit is ``i``, which makes ``imath`` ambiguous. It also has no conflict
104104
with any PyPI module. On the other hand, ``intmath`` may be confused with
105105
interval math or numerical integration.
106106

@@ -115,7 +115,7 @@ Unless we can just provide bindings to some well supported mathematical library
115115
like the GMP, the module scope should be limited. For example, no efficient primality
116116
testing and factorization.
117117

118-
There are possible additions, among proposed in the initial discussion thread
118+
Some possible additions, among those proposed in the initial discussion thread
119119
(see also issue
120120
`python/cpython#81313 <https://github.com/python/cpython/issues/81313>`_):
121121

@@ -124,10 +124,10 @@ There are possible additions, among proposed in the initial discussion thread
124124
* ``gcdext()`` --- to solve linear `Diophantine equation <https://en.wikipedia.org/wiki/Diophantine_equation>`_ in two variables (the
125125
:external+py3.14:class:`int` implementation actually includes an extended
126126
Euclidean algorithm)
127-
* ``isqrt_rem()`` --- to return both integer square root and a remainder (if
127+
* ``isqrt_rem()`` --- to return both integer square root and a remainder (which is non-zero only if
128128
integer isn't a perfect square)
129129
* ``ilog()`` --- integer logarithm, :external+py3.14:func:`math.log`
130-
has a special handling for integer arguments. It's unique (with respect to other module
130+
has special handling for integer arguments. It's unique (with respect to other module
131131
functions) and not documented so far, see issue
132132
`python/cpython#120950 <https://github.com/python/cpython/issues/120950>`_.
133133
* ``fibonacci()`` --- `Fibonacci sequence <https://en.wikipedia.org/wiki/Fibonacci_sequence>`_.
@@ -146,8 +146,8 @@ would be confusing to give it the same name (under a different module).
146146
Acknowledgements
147147
================
148148

149-
Thanks to Tim Peters for reviving the idea of the :external+py3.14:mod:`math`
150-
splitting. Thanks to Neil Girdhar for substantial improvements of
149+
Thanks to Tim Peters for reviving the idea of splitting the :external+py3.14:mod:`math`
150+
module. Thanks to Neil Girdhar for substantial improvements of
151151
the initial draft.
152152

153153

0 commit comments

Comments
 (0)