FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131178: Update help message for `timeit` CLI by donbarbos · Pull Request #131326 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 1 addition & 3 deletions Lib/test/test_timeit.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ def test_main_negative_reps(self):
@unittest.skipIf(sys.flags.optimize >= 2, "need __doc__")
def test_main_help(self):
s = self.run_main(switches=['-h'])
# Note: It's not clear that the trailing space was intended as part of
# the help text, but since it's there, check for it.
self.assertEqual(s, timeit.__doc__ + ' ')
self.assertEqual(s, timeit.__doc__)

def test_main_verbose(self):
s = self.run_main(switches=['-v'])
Expand Down
3 changes: 1 addition & 2 deletions Lib/timeit.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
timeit(string, string) -> float
repeat(string, string) -> list
default_timer() -> float

"""

import gc
Expand Down Expand Up @@ -302,7 +301,7 @@ def main(args=None, *, _wrap_timer=None):
precision += 1
verbose += 1
if o in ("-h", "--help"):
print(__doc__, end=' ')
print(__doc__, end="")
return 0
setup = "\n".join(setup) or "pass"

Expand Down

Back | FazBrowse Home | New Git URL