[issue40028] Math module method to find prime factors for non-negative int n

Rémi Lapeyre report at bugs.python.org
Fri May 22 06:23:06 EDT 2020


Rémi Lapeyre <remi.lapeyre at henki.fr> added the comment:

Hi Mark Dickinson, I was waiting for everyone to have a chance to comment on this issue and read their reply before answering.

It seems to me that there some core developers are mildly in favor of a new imath module and it's has been proposed on the bug tracker and python-ideas while other would prefer it as an external package.

I agree with the idea that that using gfactor is not the best, it may not be installed and has different names on different OS. The state of the art algorithms used by others languages and libraries for numbers up to 2**64 are not very complicated, as Steven D'Aprano said deterministic MR works incredibly well for numbers < 2**64 and that's what I implemented with a probabilistic test for larger number. It only misses a Lucas test to be a complete Baillie–PSW test.

As you said the PEP would have to explain why not just use sympy and honestly I don't have a very good argument there for now.

In the end, if some core devs think that putting together the various discussions for an imath module in a coherent PEP so it can be discussed and either:

 - accepted and merged,
 - refused with some functions merged in math,
 - definitely put to bed

would be useful and prevent additional discussions around this idea, I'm willing to do the leg work (thought I may take me some time).

If nobody thinks it would be really helpful, I may focus my time on other issues.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40028>
_______________________________________


More information about the Python-bugs-list mailing list