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 — gh-131178: Update help message for `timeit` CLI by donbarbos · Pull Request #131326 · python/cpython

Conversation

@donbarbos

@donbarbos donbarbos commented Mar 16, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I thought it was weird to have next end for the help message. The one who added test case also noticed this and commented it.
I didn't find where it could be useful and also unexpectedly, this is what it looks like when I run ./python -m timeit -h:

main branch PR branch
Screenshot from 2025-03-16 15-39-11 Screenshot from 2025-03-16 15-38-56
  • Issue: Add tests for command-line interface #131178

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@donbarbos
Update help message for timeit CLI
ecc09d4
@bedevere-app bedevere-app Bot added the awaiting review label Mar 16, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 16, 2025
Add tests for command-line interface #131178
Open
7 of 9 tasks
@picnixz picnixz added the skip news label Mar 16, 2025
@picnixz

picnixz commented Mar 16, 2025

Copy link
Copy Markdown
Member

Is the % part of the output or is it your terminal emulator? I think it's fine to have an empty line at the end so that it's a bit easier to read but I don't have a strong opinion on it though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Mar 16, 2025
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if this was correct, so I checked some GNU help pages. Conclusion -- it seems to be.

I did however like the handy link to the online docs.

$ cat --help

...

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/cat>
or available locally via: info '(coreutils) cat invocation'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@donbarbos

donbarbos commented Mar 16, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

% appears if you set end=' ' as an argument to the print function (by default end='\n' but I changed to end='')

and the first empty line appears as it is in timeit.__doc__ (I removed it from doc string)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Mar 16, 2025

Copy link
Copy Markdown
Member

What I meant is that on your second screenshot:

image

There is no newline between the end of the help and the prompt. I think we need a new line, as we currently have (but without %)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos

donbarbos commented Mar 16, 2025

Copy link
Copy Markdown
Contributor Author

got it. we can either remove end argument or leave empty line at the end of __doc__

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos
Back one empty line
da4d71f
@hugovk

hugovk commented Mar 28, 2025

Copy link
Copy Markdown
Member

Yeah, I can repro the percent on main (last alpha shown here):

image

argparse CLI help has a single blank line at the end:

image

And with this PR we get two blank lines:

image

If we remove this newline (that is, revert da4d71f) we get a single blank line:

image

Please can you revert da4d71f? Thanks!

donbarbos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos

donbarbos commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

argparse doesn't have empty lines. I think you have one empty line because of your environment theme (line with a blue triangle).
Screenshot from 2025-03-28 21-08-35

currently for main branch we get two empty lines for timeit I suggested removing both but @picnixz suggested leaving one so I put one back.

but i can remove the second one again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos
Revert "Back one empty line"
8f04290
This reverts commit da4d71f.
@hugovk
hugovk merged commit 55150a7 into python:main Mar 30, 2025
@bedevere-app bedevere-app Bot removed the awaiting review label Mar 30, 2025
@hugovk

hugovk commented Mar 30, 2025

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@StanFromIreland StanFromIreland StanFromIreland left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@donbarbos @picnixz @hugovk @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — 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.