◐ Shell
clean mode source ↗

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.

@rdb

If _PyGen_FetchStopIterationValue is no longer public, what is the supported replacement we should use in our project?

rdb added a commit to panda3d/panda3d that referenced this pull request

Aug 5, 2023

@vstinner

@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.

@rdb

rdb commented

Aug 26, 2023

Loading

@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.

@vstinner

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

@rdb

It's not necessary, unless you're telling me that PyStopIterationObject is going to become opaque in the future.

lachbr pushed a commit to toontownretro/panda that referenced this pull request

Feb 17, 2024