Clean Singleton Docstrings

Chris Angelico rosuav at gmail.com
Sun Jul 17 03:51:47 EDT 2016


On Sun, Jul 17, 2016 at 5:41 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> The trouble is, repeated addition of fractions is *able* to deliver an
>> exact result. It just might result in an incredibly slow program.
>
> True, although the programmer has control over the feature. If you
> *want* the luxury of exact fractions, you pay the price. If you don't,
> you make the numbers inexact.

Not if you have a single "Number" type:

On Sat, Jul 16, 2016 at 4:53 PM, Random832 <random832 at fastmail.com> wrote:
> Eliminate both of them. Move to a single abstract numeric type* a la
> Scheme, with an "inexact" attribute (inexact numbers may or may not be
> represented by a float, or by the same bigint/decimal/rational types as
> exact ones with a flag set to mark them as inexact.)

Currently yes, you can choose to use fractions.Fraction and pay the
price. How, if you have a single type with different representations,
can you make that choice?

ChrisA



More information about the Python-list mailing list