You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why not fix the :external+py3.14:mod:`math` module documentation instead?
85
+
Sure, we can be much more vague in the module preamble (i.e. roughly say
86
+
that "the :external+py3.14:mod:`math` module contains some mathematical
87
+
functions"), we can accurately describe input/output for each function
88
+
and it's behavior (e.g. whether the :external+py3.14:func:`~math.factorial`
89
+
output is exact or not, like e.g. the `scipy.special.factorial <https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.factorial.html#scipy.special.factorial>`_, per default).
90
+
91
+
But the major issue is that the current module mixes different, almost non-interlaced
92
+
application domains. Adding more documentation will just highlight this and
93
+
make the issue worse for end users (more text to read/skip). And it will not
94
+
fix issue with discoverability (to know in which module to find a function, and
95
+
that it can be found at all, you need to look at all the functions in the
96
+
module), nor with tab-completion.
97
+
56
98
57
99
Specification
58
100
=============
59
101
60
102
The PEP proposes moving the following integer-related functions to a new
61
-
module, called ``imath``:
103
+
module, called ``intmath``:
62
104
63
105
* :external+py3.14:func:`~math.comb`
64
106
* :external+py3.14:func:`~math.factorial`
@@ -74,9 +116,23 @@ Module functions will accept integers and objects that implement the
74
116
object to an integer number. Suitable functions must be computed exactly,
75
117
given sufficient time and memory.
76
118
77
-
Possible extensions for the new module and its scope are discussed in the
78
-
`Open Issues <Open Issues_>`_ section. New functions are not part of this
79
-
proposal.
119
+
The :pypi:`intmath` package will provide new module for older Python versions.
120
+
121
+
122
+
Possible Extensions
123
+
===================
124
+
125
+
New functions (like mentioned in `Motivation <Motivation_>`_ section) are not
126
+
part of this proposal.
127
+
128
+
Though, we should mention that, unless we can just provide bindings to some
129
+
well supported mathematical library like the GMP, the module scope should be
130
+
limited. For example, no primality testing and factorization, as
131
+
production-quality implementatons will require a decent mathematical background
132
+
from contributors and belongs rather to specialized libraries.
133
+
134
+
When proposed function already exists in the :pypi:`gmpy2`, we should prefer a
0 commit comments