GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add colour to `timeit` CLI output · Issue #146609 · python/cpython

Add colour to timeit CLI output #146609

New issue
Copy link
New issue
Copy link
Closed
Closed
Add colour to timeit CLI output#146609
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@hugovk
hugovk
opened on Mar 29, 2026
Issue body actions

Feature or enhancement

Proposal:

Taking inspiration from CLI tools such as hyperfine:

Image Image

Let's add colour to the CLI output of python -m timeit.

Standard and verbose:

./python.exe -m timeit "'-'.join(str(n) for n in range(100))"
./python.exe -m timeit --verbose "'-'.join(str(n) for n in range(100))"
image

With a warning:

./python.exe -m timeit --verbose "import time, random; time.sleep(random.random() * 0.5)"
image

As usual, environment variables can control colour output.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-146609: Add colour to timeit CLI output #146610
  • gh-146609: Use argparse for colour help timeit CLI #149334

Activity

  1. hugovk
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Mar 29, 2026
  2. hugovk
    added a commit that references this issue on Apr 8, 2026

    gh-146609: Add colour to `timeit` CLI output (#146610)

    8687b9d
  3. StanFromIreland
    closed this as completedon Apr 9, 2026
  4. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-146609: Add colour to `timeit` CLI output (python#146610)

    174508f
  5. hugovk
    added a commit that references this issue on May 4, 2026

    gh-146609: Use argparse for colour help timeit CLI (#149334)

    3506125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.