[issue37884] Optimize Fraction() and statistics.mean()

Mark Dickinson report at bugs.python.org
Tue Aug 20 10:11:57 EDT 2019


Mark Dickinson <dickinsm at gmail.com> added the comment:

> This issue if for optimization only. It does not expand the math module API.

I think it does, though. The PR adds something to the math module that's tested, that needs to be maintained for other modules to work, and that's imported for use in another module; that smells like an element of the API to me, even with the leading underscore in the name. Other Python implementations would also need to implement math._as_integer_ratio for the pure Python fractions code to continue working. If we're going to expand the math module API to include such a function (and I don't think we should), we should do it properly: remove the leading underscore, and add documentation. But as you say, that's a separate issue.

I'm with Raymond here; I don't think this change is desirable for the math module, either with or without the leading underscore in the name.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37884>
_______________________________________


More information about the Python-bugs-list mailing list