Clean Singleton Docstrings

Marko Rauhamaa marko at pacujo.net
Sat Jul 16 17:27:34 EDT 2016


Chris Angelico <rosuav at gmail.com>:

> In that case, an 'Exact' non-integer will have appalling performance -
> fractions.Fraction doesn't really work all that nicely when the
> numbers start getting huge.

In Scheme, any math operation is allowed to drop exactness:

   If one of these procedures is unable to deliver an exact result when
   given exact arguments, then it may either report a violation of an
   implementation restriction or it may silently coerce its result to an
   inexact number.

   <URL: http://www.schemers.org/Documents/Standards/R5RS/HTML/r5r
   s-Z-H-9.html#%_sec_6.2.3>


Now, that's neither the recommendation nor the reality; exactness is
preserved at the expense of efficiency. However, that's unlikely to be
an issue in the normal use of Python's Decimal.


Marko



More information about the Python-list mailing list