Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
On Sat, Aug 24, 2019 at 10:09:40AM +0000, Serhiy Storchaka wrote: > Could you please explain what is wrong in adding a helper function > which will help to convert different types of numbers to integer ratio > correctly? > > Currently you need to write a complex code if you need to convert a > general number to integer ratio: When I first wrote the statistics module, I found that converting to fractions was a bottleneck. I spent some time tweaking the private _exact_ratio() function which is why the code is so hairy. Being able to simplify and speed up that conversion would be great, and I thank Serhiy for looking at this. But I am concerned about the API, writing a *private* helper function in the math module, but then using it in the statistics module as if it were public. That will surely encourage people to do the same, and before long this private helper will have to be treated as public. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37884> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com