diff --git a/peps/pep-0791.rst b/peps/pep-0791.rst index 573619bfb56..ff1400ff49c 100644 --- a/peps/pep-0791.rst +++ b/peps/pep-0791.rst @@ -1,15 +1,22 @@ PEP: 791 Title: math.integer --- submodule for integer-specific mathematics functions -Author: Sergey B Kirpichev +Author: Neil Girdhar , + Sergey B Kirpichev , + Tim Peters , + Serhiy Storchaka Sponsor: Victor Stinner Discussions-To: https://discuss.python.org/t/92548 -Status: Draft +Status: Final Type: Standards Track Created: 12-May-2025 Python-Version: 3.15 Post-History: `12-Jul-2018 `__, `09-May-2025 `__, `19-May-2025 `__, +Resolution: `23-Oct-2025 `__ + + +.. canonical-doc:: `math.integer — integer-specific mathematics functions `_ Abstract @@ -146,8 +153,8 @@ Module functions will accept integers and objects that implement the object to an integer number. Suitable functions must be computed exactly, given sufficient time and memory. -The :pypi:`intmath` package will provide new submodule content for older Python -versions. +The :pypi:`intmath` package, available on PyPI, will provide new submodule +content for older Python versions. Possible Extensions @@ -169,8 +176,8 @@ compatible interface for the stdlib. Backwards Compatibility ======================= -As aliases in :external+py3.14:mod:`math` will be kept for an indefinite time -(their use would be discouraged), there are no anticipated code breaks. +As aliases in :external+py3.14:mod:`math` will be kept indefinitely (their use +would be discouraged), there are no anticipated code breaks. How to Teach This @@ -201,10 +208,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 @@ -218,15 +226,15 @@ 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 Victor Stinner for sponsoring this PEP. +Thanks to everyone who participated in the discussions on discuss.python.org, +providing feedback, especially to Oscar Benjamin, Steve Dower and Paul Moore. Copyright