gh-106320: Move private _PyGen API to the internal C API by vstinner · Pull Request #107032 · python/cpython
Move private _PyGen API to internal C API: * _PyAsyncGenAThrow_Type * _PyAsyncGenWrappedValue_Type * _PyCoroWrapper_Type * _PyGen_FetchStopIterationValue() * _PyGen_Finalize() * _PyGen_SetStopIterationValue() No longer these symbols, except of the ones by the _asyncio shared extensions.
If _PyGen_FetchStopIterationValue is no longer public, what is the supported replacement we should use in our project?
@rdb:
If _PyGen_FetchStopIterationValue is no longer public, what is the supported replacement we should use in our project?
Would you mind to open a new issue to request a public replacement function? Please explain how you use this function, and how existing API is not enough.
@vstinner We've switched to using PyErr_GetRaisedException() and extracting the value from there (see this commit), so as long as the structure of PyStopIterationObject remains part of the public ABI, I think we're good.
When can add a public function. Just open an issue to ask for it, so we can discuss the issue and decide if it's worth it
It's not necessary, unless you're telling me that PyStopIterationObject is going to become opaque in the future.