Skip to content

[struct] Add struct.pack and struct.unpack polyfills #156977

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 4 commits into
base: gh/guilhermeleobas/190/base
Choose a base branch
from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jun 26, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/156977

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Cancelled Job, 4 Unrelated Failures

As of commit 20d6316 with merge base dea4864 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jul 8, 2025
@guilhermeleobas guilhermeleobas marked this pull request as ready for review July 8, 2025 22:13
guilhermeleobas added a commit that referenced this pull request Jul 8, 2025
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jul 8, 2025
@XuehaiPan XuehaiPan requested a review from jansel July 9, 2025 00:29


@substitute_in_graph(struct.pack, can_constant_fold_through=True) # type: ignore[arg-type]
def pack(fmt: Union[bytes, str], /, *v: Any) -> bytes:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def pack(fmt: Union[bytes, str], /, *v: Any) -> bytes:
def pack(fmt: str | bytes, /, *v: Any) -> bytes:



@substitute_in_graph(struct.unpack, can_constant_fold_through=True) # type: ignore[arg-type]
def unpack(format: Union[bytes, str], buffer: bytes) -> tuple[Any, ...]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def unpack(format: Union[bytes, str], buffer: bytes) -> tuple[Any, ...]:
def unpack(format: str | bytes, buffer: collections.abc.Buffer, /) -> tuple[Any, ...]:

[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jul 10, 2025
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.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy