[Python-checkins] gh-90085: Remove vestigial -t and -c timeit options (#94941)

JelleZijlstra webhook-mailer at python.org
Fri Oct 7 18:38:29 EDT 2022


https://github.com/python/cpython/commit/cb4615fd43e678fe44e9aeb6a486475a05b492e7
commit: cb4615fd43e678fe44e9aeb6a486475a05b492e7
branch: main
author: Shantanu <12621235+hauntsaninja at users.noreply.github.com>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2022-10-07T15:38:20-07:00
summary:

gh-90085: Remove vestigial -t and -c timeit options (#94941)

See bpo-28240. The functionality was removed in 3d7feb9ac2.
The options had been deprecated since Python 3.3

files:
A Misc/NEWS.d/next/Library/2022-07-17-22-31-32.gh-issue-90085.c4FWcS.rst
M Lib/timeit.py

diff --git a/Lib/timeit.py b/Lib/timeit.py
index 9dfd454936e6..0cf8db67723a 100755
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -259,10 +259,9 @@ def main(args=None, *, _wrap_timer=None):
         args = sys.argv[1:]
     import getopt
     try:
-        opts, args = getopt.getopt(args, "n:u:s:r:tcpvh",
+        opts, args = getopt.getopt(args, "n:u:s:r:pvh",
                                    ["number=", "setup=", "repeat=",
-                                    "time", "clock", "process",
-                                    "verbose", "unit=", "help"])
+                                    "process", "verbose", "unit=", "help"])
     except getopt.error as err:
         print(err)
         print("use -h/--help for command line help")
diff --git a/Misc/NEWS.d/next/Library/2022-07-17-22-31-32.gh-issue-90085.c4FWcS.rst b/Misc/NEWS.d/next/Library/2022-07-17-22-31-32.gh-issue-90085.c4FWcS.rst
new file mode 100644
index 000000000000..37952adc8f1a
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-07-17-22-31-32.gh-issue-90085.c4FWcS.rst
@@ -0,0 +1,3 @@
+Remove ``-c/--clock`` and ``-t/--time`` CLI options of :mod:`timeit`.
+The options had been deprecated since Python 3.3 and the functionality
+was removed in Python 3.7. Patch by Shantanu Jain.



More information about the Python-checkins mailing list