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

Expose contextvars CPython implementation #2281

Closed
pfreixes opened this issue May 19, 2018 · 2 comments · Fixed by #4088
Closed

Expose contextvars CPython implementation #2281

pfreixes opened this issue May 19, 2018 · 2 comments · Fixed by #4088

Comments

@pfreixes
Copy link

Hi,

I'm planning on use contextvars [1] within a Cython code and I would like to have access to the CPython implementation instead of accessing through the generic Python module.

Does it make sense?

In such case, I could try to work on a PR that would define the methods as a new include file behind the generic Include/cpython directory.

[1] https://docs.python.org/dev/library/contextvars.html#module-contextvars

@scoder
Copy link
Contributor

scoder commented May 21, 2018

Yes, I think covering the C-API in a .pxd file would be a good first step. Eventually, Cython should learn how to use context variables internally and make them available as efficient context managers.

@scoder
Copy link
Contributor

scoder commented Apr 27, 2021

I added convenience getter functions in ff16389.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants