-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag #25520
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
Conversation
24a99a2
to
8e8129f
Compare
@pablogsal are you ok with the PR as it is? |
Misc/NEWS.d/next/Core and Builtins/2021-04-22-10-46-40.bpo-43908.Co3YhZ.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Misc/NEWS.d/next/Core and Builtins/2021-04-22-10-46-40.bpo-43908.Co3YhZ.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Stinner <[email protected]>
Misc/NEWS.d/next/C API/2021-04-22-10-46-40.bpo-43908.Co3YhZ.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Stinner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
IMO it was important to mention "type attributes cannot be set nor deleted" to explain what "immutable" means. I stop nitpicking, let's move on to add this flag to types recently converted to heap types.
Thanks, @vstinner! I appreciate the doc/comment nitpicking; you're improved the PR considerably. |
@erlend-aasland: Travis CI failed:
|
Oops, I'll fix it. I normally do |
FYI, unrelated random ssl test failure on the macOS CI, @vstinner. |
Merged, thanks. |
Since python/cpython#25520 types are automatically marked as immutable if they are static. While we still have the Py_TPFLAGS_HEAPTYPE hack in place we need to manually mark our types as immutable. It's possible to crash Python by trying to modify mutable static types.
https://bugs.python.org/issue43908