This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients mark.dickinson, oscarbenjamin, rhettinger, tim.peters
Date 2013-09-30.18:33:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380566038.44.0.467218135144.issue19086@psf.upfronthosting.co.za>
In-reply-to
Content
The possible use cases are so varied & fuzzy it seems better to use an object for this, rather than funk-ify `fsum`.  Say, class Summer.  Then methods could be invented as needed, with whatever state is required belonging to Summer objects rather than passed around in funky calling-sequence/return conventions.  Like,

s = Summer() # new object
s.add(3.1)   # add one number to running sum
s.sum()      # returns sum so far as float: 3.1
s.update(iterable_returning_numbers)  # add a bunch of numbers to sum
s.combine(another_Summer_object)  # add Summer's
s.sum_as_decimal(precision=None) # sum so far as Decimal
s.sum_as_fraction()  # exact sum so far as Fraction

Blah blah blah ;-)
History
Date User Action Args
2013-09-30 18:33:58tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, oscarbenjamin
2013-09-30 18:33:58tim.peterssetmessageid: <1380566038.44.0.467218135144.issue19086@psf.upfronthosting.co.za>
2013-09-30 18:33:58tim.peterslinkissue19086 messages
2013-09-30 18:33:58tim.peterscreate