Uh oh!
There was an error while loading. Please reload this page.
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag - #25520
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
24a99a2 to
8e8129fCompareerlend-aasland
commented
Apr 26, 2021
Uh oh!
There was an error while loading. Please reload this page.
erlend-aasland
commented
Apr 27, 2021
@pablogsal are you ok with the PR as it is? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
erlend-aasland
commented
Apr 28, 2021
Thanks, @vstinner! I appreciate the doc/comment nitpicking; you're improved the PR considerably. |
vstinner
commented
Apr 28, 2021
@erlend-aasland: Travis CI failed: |
Uh oh!
There was an error while loading. Please reload this page.
erlend-aasland
commented
Apr 28, 2021
Oops, I'll fix it. I normally do |
erlend-aasland
commented
Apr 28, 2021
FYI, unrelated random ssl test failure on the macOS CI, @vstinner. |
vstinner
commented
Apr 28, 2021
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