Re: [Python-ideas] Add the imath module

On 2018-07-13 11:50, Jacco van Dorp wrote:
At the very least, use is_likely_prime() as function name.
I agree with you here: the function name should reflect what it actually does. (Note that the technical term is "probable prime", so it should be is_probable_prime) But I don't think that the Python stdlib should have a proven is_prime() function because that would be complicated, slow and have very limited benefit over is_probable_prime().

On Fri, Jul 13, 2018 at 01:36:55PM +0200, Jeroen Demeyer wrote:
What it *actually* does is: is_almost_certainly_prime_except_for_a_ludicrously_microscopic_chance_of_error_thousands_of_times_less_likely_than_a_stray_cosmic_ray_flipping_a_bit_in_memory_and_causing_the_wrong_result_to_be_returned() *At most*, I would agree that the isprime() function could raise a "Probably Prime" warning when necessary, with the warning disabled by default. Those that care about this sort of thing can enable warnings, those that don't shouldn't have to read scary warnings that have no practical meaning. If your bank is satisfied with "mere probable prime number" to transfer billions of dollars around the world, then I'm sure that the users of Python's std library should be too. -- Steve

On Fri, Jul 13, 2018 at 01:36:55PM +0200, Jeroen Demeyer wrote:
What it *actually* does is: is_almost_certainly_prime_except_for_a_ludicrously_microscopic_chance_of_error_thousands_of_times_less_likely_than_a_stray_cosmic_ray_flipping_a_bit_in_memory_and_causing_the_wrong_result_to_be_returned() *At most*, I would agree that the isprime() function could raise a "Probably Prime" warning when necessary, with the warning disabled by default. Those that care about this sort of thing can enable warnings, those that don't shouldn't have to read scary warnings that have no practical meaning. If your bank is satisfied with "mere probable prime number" to transfer billions of dollars around the world, then I'm sure that the users of Python's std library should be too. -- Steve
participants (2)
-
Jeroen Demeyer
-
Steven D'Aprano