◐ Shell
clean mode source ↗

Issue 45927: timeit accepts -c/--clock and -t/--time without any functionality

From the code:

        opts, args = getopt.getopt(args, "n:u:s:r:tcpvh",
                                   ["number=", "setup=", "repeat=",
                                    "time", "clock", "process",
                                    "verbose", "unit=", "help"])

but the options -c and -t are not used in the subsequent code.

This can lead to situations where if you mistype e.g. -s as -c, you get completely wrong results (see https://bugs.python.org/issue45902 for an example).