bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag#25520
Conversation
24a99a2 to
8e8129f
Compare
April 26, 2021 18:47
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
left a comment
There was a problem hiding this comment.
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.
Sorry, something went wrong.
|
Thanks, @vstinner! I appreciate the doc/comment nitpicking; you're improved the PR considerably. |
Sorry, something went wrong.
|
@erlend-aasland: Travis CI failed: |
Sorry, something went wrong.
Oops, I'll fix it. I normally do |
Sorry, something went wrong.
|
FYI, unrelated random ssl test failure on the macOS CI, @vstinner. |
Sorry, something went wrong.
|
Merged, thanks. |
Sorry, something went wrong.
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