[Python-ideas] Make Python front end to the C math module
tritium-list at sdamon.com
tritium-list at sdamon.com
Sun Jun 19 12:19:47 EDT 2016
Is the math library really the place to put functions that are not directly
related to interacting with libm?
> -----Original Message-----
> From: Python-ideas [mailto:python-ideas-bounces+tritium-
> list=sdamon.com at python.org] On Behalf Of Steven D'Aprano
> Sent: Sunday, June 19, 2016 11:03 AM
> To: python-ideas at python.org
> Subject: [Python-ideas] Make Python front end to the C math module
>
> Currently the math module is written in C, not Python. This greatly
> increases the barrier to contributions to math. I suggest that we treat
> the existing math module as an accelerator module:
>
> - rename math.so to _math.so;
> (or whatever platform-specific name it uses)
>
> - add math.py with something like the following content:
>
> from _math import *
>
>
> and we're done! That will make it easier for people to contribute pure
> Python functions in the future. Currently all math functions, regardless
> of how trivial or difficult, must be written in C. With this change,
> they can be written in Python, and only written in C if necessary.
>
> For the avoidance of doubt, there is NO requirement for pure-Python
> implementations of the existing math functions, or even future ones.
> Future functions can go straight into the C implementation is desired.
> This is to allow future functions the opportunity to be written in
> Python.
>
>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
More information about the Python-ideas
mailing list