Skip to content
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

gh-106320: Move private _PyGen API to the internal C API #107032

Merged
merged 1 commit into from Jul 22, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jul 22, 2023

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.

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.
@vstinner vstinner enabled auto-merge (squash) July 22, 2023 14:04
@vstinner vstinner merged commit ae8b114 into python:main Jul 22, 2023
20 of 21 checks passed
@vstinner vstinner deleted the internal_gen_types branch July 22, 2023 14:47
@rdb
Copy link

rdb commented Aug 4, 2023

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
Copy link
Member Author

@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
Copy link

rdb commented Aug 26, 2023

@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
Copy link
Member Author

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
Copy link

rdb commented Aug 26, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants