-
Notifications
You must be signed in to change notification settings - Fork 247
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
Clarify that const is being cast away #302
Conversation
I get one test failure locally:
|
9fe8746 is no longer needed due to CPython considering this a regression and fixing in python/cpython#92138 |
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). |
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. |
It got merged, so I suggest closing this PR which will no longer be needed with the future Python 3.11 beta2. |
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. |
I suggest you dropping the usage of |
See also python/cpython#91768 Fixes #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#91768 Fixes #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)