classification
Title: Python C API version of `fractions` module
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: lycantropos, mark.dickinson
Priority: normal Keywords:

Created on 2021-07-13 16:15 by lycantropos, last changed 2021-08-20 09:37 by mark.dickinson. This issue is now closed.

Messages (3)
msg397424 - (view) Author: Azat Ibrakov (lycantropos) Date: 2021-07-13 16:15
Are there any plans for implementing `fractions` module in C (like  for `decimal` there is a https://github.com/python/cpython/blob/main/Modules/_decimal/_decimal.c module)?
I've implemented one myself (https://github.com/lycantropos/cfractions) and from benchmarks (available at https://stackoverflow.com/a/67821911/5997596) we can see that it can be faster that current pure Python implementation.
msg397429 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2021-07-13 16:52
No, no plans. There are tradeoffs here - the extra speed comes at the expense of increased maintenance burden. (It's certainly much harder to make minor changes and fixes to the decimal module now that it's written in C.)
msg399946 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2021-08-20 09:37
Closing here. I think we'd need a PEP and a wider discussion to take this forward.
History
Date User Action Args
2021-08-20 09:37:26mark.dickinsonsetstatus: open -> closed
resolution: rejected
messages: + msg399946

stage: resolved
2021-07-13 16:52:09mark.dickinsonsetnosy: + mark.dickinson
messages: + msg397429
2021-07-13 16:15:43lycantroposcreate