Uh oh!
There was an error while loading. Please reload this page.
bpo-43973: Use Py_TPFLAGS_IMMUTABLETYPE to check for class assignments - #25714
Conversation
erlend-aasland
commented
Apr 29, 2021
erlend-aasland
commented
Apr 29, 2021
AFAICS, this does not require a news item, but I might be wrong. |
shreyanavigyan
commented
Apr 29, 2021
Doesn't this also require a change? Lines 4679 to 4690 in e047239 Suggested :- |
AFAICT, no. They adjust the ref. count if heap types are used: If the old class was a heap type, decrement its ref. count. If the new class is a heap type, acquire a strong reference to it (increment the ref. count). |
Uh oh!
There was an error while loading. Please reload this page.
89a5079 to
3023aafCompareerlend-aasland
commented
Apr 30, 2021
Thanks for reviewing, @vstinner ! |
vstinner
commented
Apr 30, 2021
Merged, thanks for the fix. |
pitrou
commented
Apr 30, 2021
The comment above the check should have been fixed to reflect the new semantics, no? Also, is the explicit check for |
Yes, and I believe it can be considerably reduced.
I don't know. See bpo-24912. |
See also bpo-43908
https://bugs.python.org/issue43973