Skip to content

gh-155406: Fix struct.unpack_from documentation signature - #155408

Closed
shoutoutuoadi325 wants to merge 1 commit into
python:mainfrom
shoutoutuoadi325:gh-155406-struct-doc-fix
Closed

gh-155406: Fix struct.unpack_from documentation signature#155408
shoutoutuoadi325 wants to merge 1 commit into
python:mainfrom
shoutoutuoadi325:gh-155406-struct-doc-fix

Conversation

@shoutoutuoadi325

@shoutoutuoadi325 shoutoutuoadi325 commented Aug 9, 2026

Copy link
Copy Markdown

Problem: The struct.unpack_from() documentation incorrectly shows a '/' separator in the signature.

Solution: Remove the spurious '/' separator. The correct signature is unpack_from(format, buffer, offset=0).

Changes: Modified Doc/library/struct.rst to fix the function signature.

Testing: This is a documentation-only change that matches the actual function signature and usage in test code.

Compatibility: No behavior changes, documentation correction only.

Remove the spurious '/' separator in the struct.unpack_from() signature
documentation. The actual function signature is unpack_from(format, buffer, offset=0),
not unpack_from(format, /, buffer, offset=0).

This matches the actual function signature and the usage in test code.
Copilot AI lite review requested due to automatic review settings August 9, 2026 06:32
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Aug 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98337f0068

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Doc/library/struct.rst


.. function:: unpack_from(format, /, buffer, offset=0)
.. function:: unpack_from(format, buffer, offset=0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the positional-only marker for format

When callers follow this signature and pass format by keyword, struct.unpack_from(format='I', buffer=data) raises TypeError. The Argument Clinic declaration in Modules/_struct.c still places format before /, and the generated text signature remains unpack_from($module, format, /, buffer, offset=0), so removing this marker makes the documentation contradict the actual API.

Useful? React with 👍 / 👎.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33978293 | 📁 Comparing 98337f0 against main (998b890)

  🔍 Preview build  

1 file changed
± library/struct.html

@picnixz picnixz closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants