Tim Peters added the comment: 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 ;-) ---------- nosy: +tim.peters _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19086> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com