Skip to content

gh-132983: Convert zstd __new__ methods to Argument Clinic #133860

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented May 11, 2025

  • merge the tp_init functions into tp_new and convert the latter to AC. This also means we can remove the initialised member from the object structs.
  • Change the signature of ZstdDict to make the content positional-only and is_raw kw-only.
  • Use Zstandard where appropriate to refer to the compression algorithm, instead of the reference implementation.

A

cc @Rogdham

@AA-Turner AA-Turner requested a review from emmatyping May 11, 2025 02:42
@AA-Turner AA-Turner added skip news needs backport to 3.14 bugs and security fixes labels May 11, 2025
@AA-Turner AA-Turner changed the title gh-133856: Convert zstd __new__ methods to Argument Clinic gh-132983: Convert zstd __new__ methods to Argument Clinic May 11, 2025
is_raw: bool = False
If true, perform no checks on *dict_content*, useful for some
advanced cases. Otherwise, check that the content represents
a Zstandard dictionary created by the zstd functions.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
a Zstandard dictionary created by the zstd functions.
a Zstandard dictionary created by the zstd library or CLI.

"the zstd functions" sounds a bit awkward here, maybe something like this is a bit better?

"a specified format.\n\n"
"0 means a \"raw content\" dictionary, free of any format restriction, used\n"
"for advanced user.");
"The ID of Zstandard dictionary, an integer between 0 and 2**32.\n\n"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"The ID of Zstandard dictionary, an integer between 0 and 2**32.\n\n"
"The ID of the Zstandard dictionary, an int between 0 and 2**32.\n\n"

Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

A few suggestions but otherwise looks great!

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

Successfully merging this pull request may close these issues.

2 participants