Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-134861: Add CSV and 🍌SV output formats toasyncio ps
#134862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
# Conflicts:#Lib/asyncio/tools.py
(Skipping news because this is an easter egg) |
@ZeroIntensity Hmm... But isn't the CSV format legit, so in my (very bad) opinion it still need news? |
Oh, hm. I guess we could add an entry for only CSV. I'll leave the decision to@dpdani. |
class TaskTableOutputFormat(Enum): | ||
table = "table" | ||
csv = "csv" | ||
bsv = "bsv" |
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.
Perhaps for the Easter Egg, make the argument the literal banana emoji, 'bsv' is too generic. Please also add some sort of reference for the future in a comment as to why bananas are relevant.
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.
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.
@danielhollas I would agree to change the argument to🍌 sv
. What do you think?
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.
Copying my comment from#134862 (comment)
This would print the 🍌sv option in the argparse help, right? Is that desired? (I don't care about hiding it, but I think it could be very confusing for users, and also may display weirdly if they don't have a proper font installed).
Don't have a strong opinion 🤷♂️
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.
Thanks@danielhollas, I agree.@dpdani please hide this from the argparse help (in whatever form the argument ends up being;'🍌'
/'🍌sv'
/'bsv'
)
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.
Yep... but bsv is too generic. Wewant to be hacky, the hackier the harder for users to find and the greater joy it brings to the Python community.
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 don't feel that hacking our way through argparse for the purpose of hiding this option would be wise, so I would just keep it as-is.
If there are no strong objections I would go ahead and resolve this discussion.
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.
You could use a metavar:metavar="{table,csv}"
which hides it from help.
$ python tmp.py --format tsv usage: tmp.py [-h] [--format {table,csv}]tmp.py: error: argument --format: invalid choice:'tsv' (choose from table, csv, bsv)
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.
Cool! I didn't know about that, I'll make the change tomorrow 👍
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.
Done ✅
I've decided to keep the option asbsv
because emojis might be funky for some terminals, and in general are harder to type out.
This is the new behavior:
$ ./python.exe -m asyncio ps 9473 --help usage: python3 -m asyncio ps [-h] [--format {table,csv}] pidpositional arguments: pid Process ID to inspectoptions: -h, --help show this help message and exit --format {table,csv}$ ./python.exe -m asyncio ps 9473 --format bsv tid🍌task id🍌task name🍌coroutine chain🍌awaiter name🍌awaiter id38847🍌0x1013265d0🍌Task-2🍌🍌🍌0x0
As pointed out above giving a wrong format gives a hint to the big secret 🍌
$ ./python.exe -m asyncio ps 9473 --format ciaousage: python3 -m asyncio ps [-h] [--format {table,csv}] pidpython3 -m asyncio ps: error: argument --format: invalid choice: 'ciao' (choose from table, csv, bsv)
Yes, please add news for CSV format |
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.
Yep, agreed with the NEWS part. But might it make the Easter Egg too obvious? Since people can just look at the PR through news. I think we might be able to split up the PRs into CSV and BSV and skip news on the latter, but it might be too much work.
class TaskTableOutputFormat(Enum): | ||
table = "table" | ||
csv = "csv" | ||
bsv = "bsv" |
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
AA-Turner commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
We're not trying to hide or obsfucate; just not to advertise. |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
python-cla-botbot commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sure, resolve. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
asyncio ps
#134861