Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing references to cli flags for pickletools #130973

Open
donBarbos opened this issue Mar 8, 2025 · 6 comments
Open

Missing references to cli flags for pickletools #130973

donBarbos opened this issue Mar 8, 2025 · 6 comments
Labels
docs Documentation in the Doc dir pending The issue will be closed if no feedback is provided

Comments

@donBarbos
Copy link
Contributor

donBarbos commented Mar 8, 2025

Documentation

While looking for more examples for issue #130160 i found that the pickletools CLI documentation doesn't cover all the flags. I know many CLI docs don't mention the -h flag but this one also doesn't mention the -t and -v flags

./python -m pickletools -h output:

usage: python -m pickletools [-h] [-o OUTPUT] [-m] [-l INDENTLEVEL] [-a] [-p PREAMBLE] [-t] [-v] [pickle_file ...]

disassemble one or more pickle files

positional arguments:
  pickle_file           the pickle file

options:
  -h, --help            show this help message and exit
  -o, --output OUTPUT   the file where the output should be written
  -m, --memo            preserve memo between disassemblies
  -l, --indentlevel INDENTLEVEL
                        the number of blanks by which to indent a new MARK level
  -a, --annotate        annotate each line with a short opcode description
  -p, --preamble PREAMBLE
                        if more than one pickle file is specified, print this before each disassembly
  -t, --test            run self-test suite
  -v                    run verbosely; only affects self-test run

Link to current documentation: https://docs.python.org/dev/library/pickletools.html

Image

Linked PRs

@picnixz
Copy link
Member

picnixz commented Mar 8, 2025

The t flag is probably something internal that we don't want to expose and the v flag then becomes also internal as it only affects self-tests.

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Mar 8, 2025
@picnixz
Copy link
Member

picnixz commented Mar 8, 2025

Note: even if they are available through -h/--help I don't think we want to document them explicitly

@picnixz
Copy link
Member

picnixz commented Mar 8, 2025

cc @serhiy-storchaka wdyt?

@alex-semenyuk
Copy link

alex-semenyuk commented Mar 8, 2025

imho don't see something bad to have consistency between -help and doc. any reason against this?

@picnixz
Copy link
Member

picnixz commented Mar 8, 2025

Yes, because it's something not meant for the enduser. It's only used for running self-tests so it's not really the purpose of the tool.

Ideally, I would rather move the self-testing into the regular test directory instead but self-testing is sometimes used by the module's maintainer if they don't want to run the entire test suite.

@picnixz
Copy link
Member

picnixz commented Mar 8, 2025

For instance, the only output that the enduser should expect from using -t is "SUCCESS" because otherwise something really went wrong when we released Python. So I don't think we need to document those two commands (IIRC there are other modules with this kind of self-testing and I don't think we actually documented them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir pending The issue will be closed if no feedback is provided
Projects
Status: Todo
Development

No branches or pull requests

3 participants