-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-43973: Use Py_TPFLAGS_IMMUTABLETYPE to check for class assignments #25714
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
AFAICS, this does not require a news item, but I might be wrong. |
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). |
89a5079
to
3023aaf
Compare
Thanks for reviewing, @vstinner ! |
Merged, thanks for the fix. |
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