gh-134786: Py_TPFLAGS_MANAGED_WEAKREF and Py_TPFLAGS_MANAGED_DICT must be used only if Py_TPFLAGS_HAVE_GC set#135863
Conversation
…hecking of it presence
|
@markshannon Please take a look. |
|
As the person who reported #134786: I would suggest making the documentation more explicit and replacing should with must here, especially since the code now errors out if |
+1 Additionally, this PR puts this into a WhatsNew entry for 3.15. This is not a new thing, this is a documentation fix + fix for the runtime to not allow these invalid types to be created. So I think the added whatsnew is misleading. |
|
I'm not sure if we should support I think the current version needs some updates and clarification in the docs. First, though, I would like to get some feedback on the overall approach. Is this the right way to do after all? Please take a look if someone interested. |
|
@markshannon Please take a look. |
efimov-mikhail
left a comment
There was a problem hiding this comment.
Maybe we should rename this PR?
I forgot to apply changes :( |
|
Once the remaining comment has been addressed, I'm happy to merge this. For the record, the requirements may change in the future: |
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
I had such commit 42c0932, we decided to revert it for now. Maybe we should open a separate PR for it? |
|
If it isn't too much work, it is worth adding a test for this. |
|
@kumaraditya303 I have added test. |
|
@markshannon @kumaraditya303 It is ready to review, could you please take a look. |
|
Thanks all! |
…PFLAGS_MANAGED_DICT` is used without `Py_TPFLAGS_HAVE_GC` set (python#135863)
According to discussion
Py_TPFLAGS_MANAGED_WEAKREFandPy_TPFLAGS_MANAGED_DICTmust be used only ifPy_TPFLAGS_HAVE_GCis set.📚 Documentation preview 📚: https://cpython-previews--135863.org.readthedocs.build/