On Tue, Oct 08, 2002 at 12:09:57PM -0400, Guido van Rossum wrote: > > > '3/5' > > I'd like at least one of those return '0.6' or '0.6r'. Why should any of them go through a potetially lossy transformation? If you need to approximate a ratio as a finite decimal fraction it should be explicit: str(float(r)). I think it will also make a good visual cue to always use rational notation for rationals and decimal fractions for floats. The result of repr() should eval() back to exactly the same object. The result of str() should be the 'pretty' representation because this is the form displayed by print statements and %s formatting. I find '2/3' prettier than '0.666666666667' pretty-is-in-the-eyes-of-the-beholder-ly yours, Oren
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4