Mark Dickinson <dicki...@gmail.com> added the comment:

BTW, the StackOverflow question helped me understand the use-case here:

  http://stackoverflow.com/q/11154954/270986

The perspective is that of a *Fraction* user who wants to be able to easily see 
the Decimal expansion of a Fraction to an arbitrary number of decimal places.  
(I was trying to understand why a *Decimal* user would care about converting 
from Fraction instances, but that's the wrong way around.)

That desire to have an easy way to see the digits of a Fraction seems 
reasonable to me, but I'm not sure that having a Decimal method is the right 
way to go about it.  Another possible solution would be to implement a decent 
__format__ method for Fraction, so that somebody could do:

>>> format(Fraction(1, 7), '.17g')
>>> '0.14285714285714286'

----------

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

Reply via email to