11PEP: 791
22Title: math.integer --- submodule for integer-specific mathematics functions
3- Author: Sergey B Kirpichev <
[email protected] >
3+ Author: Neil Girdhar <
[email protected] >,
4+ Sergey B Kirpichev <
[email protected] >,
5+ 6+ Serhiy Storchaka <
[email protected] >
47Sponsor: Victor Stinner <
[email protected] >
58Discussions-To: https://discuss.python.org/t/92548
6- Status: Draft
9+ Status: Final
710Type: Standards Track
811Created: 12-May-2025
912Python-Version: 3.15
1013Post-History: `
12-Jul-2018 <
https://mail.python.org/archives/list/[email protected] /thread/YYJ5YJBJNCVXQWK5K3WSVNMPUSV56LOR/ >`__,
1114 `09-May-2025 <https://discuss.python.org/t/91337 >`__,
1215 `19-May-2025 <https://discuss.python.org/t/92548 >`__,
16+ Resolution: `23-Oct-2025 <https://discuss.python.org/t/92548/154 >`__
17+
18+
19+ .. canonical-doc :: `math.integer — integer-specific mathematics functions <https://docs.python.org/3.15/library/math.integer.html>`_
1320
1421
1522Abstract
@@ -146,8 +153,8 @@ Module functions will accept integers and objects that implement the
146153object to an integer number. Suitable functions must be computed exactly,
147154given sufficient time and memory.
148155
149- The :pypi: `intmath ` package will provide new submodule content for older Python
150- versions.
156+ The :pypi: `intmath ` package, available on PyPI, will provide new submodule
157+ content for older Python versions.
151158
152159
153160Possible Extensions
@@ -169,8 +176,8 @@ compatible interface for the stdlib.
169176Backwards Compatibility
170177=======================
171178
172- As aliases in :external+py3.14:mod: `math ` will be kept for an indefinite time
173- (their use would be discouraged), there are no anticipated code breaks.
179+ As aliases in :external+py3.14:mod: `math ` will be kept indefinitely (their use
180+ would be discouraged), there are no anticipated code breaks.
174181
175182
176183How to Teach This
@@ -201,10 +208,11 @@ isqrt() renaming
201208---------------------------------------------
202209
203210There was a brief discussion about exposing :external+py3.14:func: `math.isqrt `
204- as ``imath.sqrt `` in the same way that :external+py3.14:func: `cmath.sqrt ` is
205- the complex version of :external+py3.14:func: `math.sqrt `. However, ``isqrt ``
206- is ultimately a different function: it is the floor of the square root. It
207- would be confusing to give it the same name (under a different module).
211+ as ``sqrt `` in the new namespace in the same way that
212+ :external+py3.14:func: `cmath.sqrt ` is the complex version of
213+ :external+py3.14:func: `math.sqrt `. However, ``isqrt `` is ultimately a
214+ different function: it is the floor of the square root. It would be confusing
215+ to give it the same name (under a different submodule).
208216
209217
210218Module name
@@ -218,15 +226,15 @@ Other proposed names include ``ntheory`` (like SymPy's submodule),
218226
219227But the SC prefers a submodule rather than a new top-level module. Most
220228popular variants of the :external+py3.14:mod: `math `'s submodule are:
221- ``integer ``, ``discrete `` or ``ntheory `` (author preference) .
229+ ``integer ``, ``discrete `` or ``ntheory ``.
222230
223231
224232Acknowledgements
225233================
226234
227- Thanks to Tim Peters for reviving the idea of splitting the
228- :external+py3.14:mod: ` math ` module. Thanks to Neil Girdhar for substantial
229- improvements of the initial draft .
235+ Thanks to Victor Stinner for sponsoring this PEP.
236+ Thanks to everyone who participated in the discussions on discuss.python.org,
237+ providing feedback, especially to Oscar Benjamin, Steve Dower and Paul Moore .
230238
231239
232240Copyright
0 commit comments