Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Actually it was ilog2. There was just an error in the documentation.

Currently we have two ways to represent the number as an integer ratio. The 
official way is two properties numerator and denominator, every number should 
have them. And some concrete numeric types have the as_integer_ratio() method 
which returns both values. Rather of adding as_integer_ratio() to all other 
numeric types I propose to add a helper function which uses either the 
as_integer_ratio() method if available, or  the numerator and denominator 
properties. Currently any code that uses the as_integer_ratio() method should 
implement a fallback to numerator and denominator. With 
imath.as_integer_ratio() it can just use this function.

> Radical suggestion: should we consider delaying the inclusions of `comb`, 
> `perm` and `isqrt` in the math module so that we can do this properly for 3.9?

I like it. I suggest to delay also adding the int.as_integer_ratio() method. 
Currently it does not help because there are other numeric methods without the 
as_integer_ratio() method.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37132>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to