On Fri, May 14, 2021 at 09:39:33PM +0100, Oscar Benjamin wrote:

> Yes, but having a faster fraction type would be great. SymPy doesn't
> actually use the fractions module because it's too slow. Instead SymPy
> has its own pure Python implementation that is a little faster and
> will use gmpy2's mpq type if gmpy2 is installed. The mpq type is
> something like 30x faster than Fraction. The fmpq type from
> python_flint is around twice as fast again and is particularly fast
> for small rationals.

Can we not improve the implementation of Fraction? What do the non-gmpy 
versions do that makes them faster?

The statistics module relies on Fraction for much of its calculations, 
improving Fraction would have a direct benefit for that. Just sayin'...



-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4QFTXHMHIUA6V5IQJT6XC45GXMIFMVC3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to