Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
trac #15398 corrected sagetimeit grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhatt21 committed Feb 27, 2020
1 parent 31cb54b commit bc52a1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sage/misc/sage_timeit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ def __repr__(self):
sage: from sage.misc.sage_timeit import SageTimeitResult
sage: stats = (1, 2, int(3), pi, 'ns')
sage: SageTimeitResult(stats) #indirect doctest
1 loops, best of 2: 3.14 ns per loop
1 loop, best of 2: 3.14 ns per loop
"""
s = u"%d loops, best of %d: %.*g %s per loop" % self.stats
if self.stats[0] > 1:
s = u"%d loops, best of %d: %.*g %s per loop" % self.stats
else:
s = u"%d loop, best of %d: %.*g %s per loop" % self.stats

if isinstance(s, str):
return s
return s.encode("utf-8")
Expand Down Expand Up @@ -269,3 +273,4 @@ def sage_timeit(stmt, globals_dict=None, preparse=None, number=0, repeat=3, prec
order = 3
stats = (number, repeat, precision, best * scaling[order], units[order])
return SageTimeitResult(stats,series=series)

0 comments on commit bc52a1c

Please sign in to comment.