[Python-ideas] Add the imath module

Steven D'Aprano steve at pearwood.info
Fri Jul 13 08:11:11 EDT 2018


On Fri, Jul 13, 2018 at 01:36:55PM +0200, Jeroen Demeyer wrote:
> 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.

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


More information about the Python-ideas mailing list