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

Struct class lives in _struct #12980

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Struct class lives in _struct #12980

merged 2 commits into from
Nov 8, 2024

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Nov 7, 2024

This one is an improvement on 3.9+. On 3.8, the Struct class calls itself builtins.Struct instead, which we can't and won't match. struct.error is defined in _struct.c, but always called itself struct.error.

>>> import struct
>>> struct.Struct
<class '_struct.Struct'>

No changes, just a move.

This one is an improvement on 3.9+. On 3.8, the Struct class
calls itself `builtins.Struct` instead, which we can't and won't
match. `struct.error` is defined in `_struct.c`, but always called
itself `struct.error`.

This comment has been minimized.

stdlib/struct.pyi Outdated Show resolved Hide resolved
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Copy link
Contributor

github-actions bot commented Nov 8, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 27286c6 into python:main Nov 8, 2024
63 checks passed
@tungol tungol deleted the struct branch November 8, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants