|
1 | 1 | PEP: 791 |
2 | | -Title: imath --- module for integer-specific mathematics functions |
| 2 | +Title: intmath --- module for integer-specific mathematics functions |
3 | 3 | Author: Sergey B Kirpichev <skirpichev@gmail.com> |
4 | 4 | Sponsor: Victor Stinner <vstinner@python.org> |
5 | 5 | Discussions-To: https://discuss.python.org/t/92548 |
@@ -34,7 +34,7 @@ when explicitly noted otherwise, all return values are floats." This is no |
34 | 34 | longer true: *None* of the functions listed in the `Number-theoretic |
35 | 35 | functions <https://docs.python.org/3.14/library/math.html#number-theoretic-functions>`_ |
36 | 36 | 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 |
38 | 38 | return values are integers." would be accurate. In a similar way we |
39 | 39 | can simplify the description of the accepted arguments for functions in both the |
40 | 40 | new module and in :external+py3.14:mod:`math`. |
@@ -82,7 +82,7 @@ Specification |
82 | 82 | ============= |
83 | 83 |
|
84 | 84 | The PEP proposes moving the following integer-related functions to a new |
85 | | -module, called ``imath``: |
| 85 | +module, called ``intmath``: |
86 | 86 |
|
87 | 87 | * :external+py3.14:func:`~math.comb` |
88 | 88 | * :external+py3.14:func:`~math.factorial` |
@@ -134,31 +134,6 @@ Reference Implementation |
134 | 134 | Open Issues |
135 | 135 | =========== |
136 | 136 |
|
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 | | - |
162 | 137 | Module scope and possible extensions |
163 | 138 | ------------------------------------ |
164 | 139 |
|
@@ -192,6 +167,23 @@ compatible interface for the stdlib. |
192 | 167 | Rejected ideas |
193 | 168 | ============== |
194 | 169 |
|
| 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 | + |
195 | 187 | There was a brief discussion about exposing :external+py3.14:func:`math.isqrt` |
196 | 188 | as ``imath.sqrt`` in the same way that :external+py3.14:func:`cmath.sqrt` is |
197 | 189 | the complex version of :external+py3.14:func:`math.sqrt`. However, ``isqrt`` |
|
0 commit comments