Skip to content

Commit 94ccb9f

Browse files
committed
rename module, move "Module name" section
1 parent a47852e commit 94ccb9f

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

peps/pep-0791.rst

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PEP: 791
2-
Title: imath --- module for integer-specific mathematics functions
2+
Title: intmath --- module for integer-specific mathematics functions
33
Author: Sergey B Kirpichev <[email protected]>
44
Sponsor: Victor Stinner <[email protected]>
55
Discussions-To: https://discuss.python.org/t/92548
@@ -34,7 +34,7 @@ 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 return a float, but the
37-
documentation doesn't say so. In the documentation for the proposed ``imath`` module the sentence "All
37+
documentation doesn't say so. In the documentation for the proposed ``intmath`` module the sentence "All
3838
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
new module and in :external+py3.14:mod:`math`.
@@ -82,7 +82,7 @@ Specification
8282
=============
8383

8484
The PEP proposes moving the following integer-related functions to a new
85-
module, called ``imath``:
85+
module, called ``intmath``:
8686

8787
* :external+py3.14:func:`~math.comb`
8888
* :external+py3.14:func:`~math.factorial`
@@ -134,31 +134,6 @@ Reference Implementation
134134
Open Issues
135135
===========
136136

137-
Module name
138-
-----------
139-
140-
The chosen name seems consistent with one existing domain-specific mathematical module:
141-
:external+py3.14:mod:`cmath` (for complex numbers).
142-
143-
We note the `Imath
144-
<https://github.com/AcademySoftwareFoundation/Imath>`_ C++ library includes
145-
Python bindings with the same name. There is also an :pypi:`imath` project on
146-
PyPI, but only with two releases, with the most recent one four years ago. Its
147-
repository is no longer accessible.
148-
149-
`Polling showed <https://discuss.python.org/t/91337/35>`_ ``intmath`` as another
150-
popular name. The argument made was that the normal mathematical spelling of
151-
the imaginary unit is ``i``, which makes ``imath`` ambiguous. It also has no conflict
152-
with any PyPI module. On the other hand, ``intmath`` may be confused with
153-
interval math or numerical integration.
154-
155-
Other proposed names include ``ntheory`` (like SymPy's submodule),
156-
``integermath``, ``zmath``, ``dmath`` and ``imaths``.
157-
158-
As a variant, the new module can be added as a submodule of the
159-
:external+py3.14:mod:`math` (e.g. ``integer``, ``discrete`` or ``ntheory``).
160-
161-
162137
Module scope and possible extensions
163138
------------------------------------
164139

@@ -192,6 +167,23 @@ compatible interface for the stdlib.
192167
Rejected ideas
193168
==============
194169

170+
Module name
171+
-----------
172+
173+
`Polling showed <https://discuss.python.org/t/92548/67>`_ ``intmath`` as most
174+
popular candidate with ``imath`` as a second winner.
175+
176+
Other proposed names include ``ntheory`` (like SymPy's submodule),
177+
``integermath``, ``zmath``, ``dmath`` and ``imaths``.
178+
179+
As a variant, the new module can be added as a submodule of the
180+
:external+py3.14:mod:`math`: ``integer`` (most preferred), ``discrete``
181+
or ``ntheory``.
182+
183+
184+
:external+py3.14:func:`~math.isqrt` renaming
185+
---------------------------------------------
186+
195187
There was a brief discussion about exposing :external+py3.14:func:`math.isqrt`
196188
as ``imath.sqrt`` in the same way that :external+py3.14:func:`cmath.sqrt` is
197189
the complex version of :external+py3.14:func:`math.sqrt`. However, ``isqrt``

0 commit comments

Comments
 (0)