Mark Dickinson added the comment:

What happens if `self.numerator / self.denominator` returns another `Rational` 
instance?  If I create `MyRational` and `MyInteger` classes, such that the 
quotient of two `MyInteger` instances is a `MyRational` instance and the 
numerator and denominator of a `MyRational` instance are both `MyInteger` 
instances, this suggestion would lead to an infinite recursion.  OTOH, I agree 
that *something* needs to be fixed here, since having `__float__` return a 
`MyRational` instance is definitely wrong.

----------

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

Reply via email to