Uh oh!
There was an error while loading. Please reload this page.
Clarify that const is being cast away - #302
Conversation
tacaswell
commented
Apr 30, 2022
I get one test failure locally: |
tacaswell
commented
May 2, 2022
9fe8746 is no longer needed due to CPython considering this a regression and fixing in python/cpython#92138 |
tacaswell
commented
May 19, 2022
This looks like it going to be fully fixed upstream, but I think you should keep the first two commits (to make in clear in the code that const is being discarded even though CPython will do the discarding for you). |
jamadden
commented
May 19, 2022
Alright, thank you! I should actually have some time to look closely at this "soon"; I'm in the process of getting the time allotted by $WORK. |
python/cpython#92951 is the upstream PR to watch. |
vstinner
commented
May 23, 2022
It got merged, so I suggest closing this PR which will no longer be needed with the future Python 3.11 beta2. |
tacaswell
commented
May 23, 2022
I dropped the commit that did the borrrowing, but I still think that it would be good to the explicit const casting in greenlets for clarity (rather than compatibility). Leaving this to the greenlet developers to take or leave at their discretion. |
vstinner
commented
May 23, 2022
I suggest you dropping the usage of |
See also python/cpython#91768Fixes#302 Also stops building the mac wheels we ship with Ofast and debugging assertions. That's not meant for production use.
See also python/cpython#91768Fixes#302 Also stops building the mac wheels we ship with Ofast and debugging assertions. That's not meant for production use.
Closes#301I should preface this with a disclaimer that my c++ is very rusty and this is the first time I have looked at this code base. I expect this is not the correct fix, but it compiles! I get one failure locally (see below).
python/cpython#91959 switch to using "new-style" c++ casts which are (apparently) stricter about casts.
One set of changes is to explicitly strip const when passing into the C API (to increase / decrease reference counts). I think this used to work because const-ness was being ignored before. Although this was fixed upstream to work, I think it is better to still have the explicit casting.
The other set of changes is to borrow the PyObject pointer from the greenlet wrapper classes. I think this used to work because the pointer was the first element in the wrapped objected so it is safe to directly cast it, however the new-style casting balks.(dropped this commit)