This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients jdemeyer, mark.dickinson, rhettinger, serhiy.storchaka, steven.daprano
Date 2019-08-26.01:42:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20190826014221.GA25893@ando.pearwood.info>
In-reply-to <1566641380.85.0.479847824834.issue37884@roundup.psfhosted.org>
Content
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.
History
Date User Action Args
2019-08-26 01:42:30steven.dapranosetrecipients: + steven.daprano, rhettinger, mark.dickinson, serhiy.storchaka, jdemeyer
2019-08-26 01:42:30steven.dapranolinkissue37884 messages
2019-08-26 01:42:29steven.dapranocreate