Skip to content
24 changes: 14 additions & 10 deletions peps/pep-0791.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
PEP: 791
Title: math.integer --- submodule for integer-specific mathematics functions
Author: Sergey B Kirpichev <[email protected]>
Author: Neil Girdhar <[email protected]>,
Sergey B Kirpichev <[email protected]>,
Tim Peters <[email protected]>,
Serhiy Storchaka <[email protected]>
Sponsor: Victor Stinner <[email protected]>
Discussions-To: https://discuss.python.org/t/92548
Status: Draft
Status: Accepted
Type: Standards Track
Created: 12-May-2025
Python-Version: 3.15
Post-History: `12-Jul-2018 <https://mail.python.org/archives/list/[email protected]/thread/YYJ5YJBJNCVXQWK5K3WSVNMPUSV56LOR/>`__,
`09-May-2025 <https://discuss.python.org/t/91337>`__,
`19-May-2025 <https://discuss.python.org/t/92548>`__,
Resolution: `23-Oct-2025 <https://discuss.python.org/t/92548/154>`__


Abstract
Expand Down Expand Up @@ -201,10 +205,11 @@ isqrt() renaming
---------------------------------------------

There was a brief discussion about exposing :external+py3.14:func:`math.isqrt`
as ``imath.sqrt`` in the same way that :external+py3.14:func:`cmath.sqrt` is
the complex version of :external+py3.14:func:`math.sqrt`. However, ``isqrt``
is ultimately a different function: it is the floor of the square root. It
would be confusing to give it the same name (under a different module).
as ``sqrt`` in the new namespace in the same way that
:external+py3.14:func:`cmath.sqrt` is the complex version of
:external+py3.14:func:`math.sqrt`. However, ``isqrt`` is ultimately a
different function: it is the floor of the square root. It would be confusing
to give it the same name (under a different submodule).


Module name
Expand All @@ -218,15 +223,14 @@ Other proposed names include ``ntheory`` (like SymPy's submodule),

But the SC prefers a submodule rather than a new top-level module. Most
popular variants of the :external+py3.14:mod:`math`'s submodule are:
``integer``, ``discrete`` or ``ntheory`` (author preference).
``integer``, ``discrete`` or ``ntheory``.


Acknowledgements
================

Thanks to Tim Peters for reviving the idea of splitting the
:external+py3.14:mod:`math` module. Thanks to Neil Girdhar for substantial
improvements of the initial draft.
Thanks to everyone who participated in the discussions on discuss.python.org,
providing feedback, especially to Oscar Benjamin, Steve Dower and Paul Moore.


Copyright
Expand Down