-
Notifications
You must be signed in to change notification settings - Fork 50
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
add support for multiple Python3 versions (not just 3.7) #1
Comments
Whether you can use the factory class design pattern to make it compatible with existing Python versions to add functionality to Python 3.8 and above |
I’ve been thinking about two “UX” options so far:
python311 := cpy3.NewPython("3.11")
python311.PyInitialize()
import (
py3core "github.com/go-python/cpy3/core"
py311 "github.com/go-python/cpy3/3-11"
) What are your thoughts and preferences? Would appreciate any suggestions and opinions from everyone. Thanks!! |
I think the second option of multiple package imports leans closer to pragmatic go. |
Is anyone working on this issue? I want to take this up. |
@jshiwam I’m only doing experiments so far. Feel free to open a PR to collaborate. |
I don't see how you could do the (And also a big +1, I now need python3.8 and I'll want more in the future!) |
@pwaller Here only one version of cpython would be linked. My understanding is that the Core API would be implemented by the parent, and the child classes will have the implementation of specific versions. If you want to use |
@pwaller @christian-korneck here is a POC that I have created. Please take a look at it. This POC takes the second approach of having submodules for different versions rather than Using a factory function. https://github.com/jshiwam/cpy3x I have implemented really few apis currently. Let me know if this looks good, and could be developed into something that we have suggested in this issue. I have tried linking multiple interpreters and it seems to work too. |
Hi Everyone, I am building the generic version of this library for python3.
I don't understand why we have used
I just wrote a sample program to check if that's the case currently or not. The following CGO program can take more than 22 arguments.
And it works without any issues. Was it a limitation before when this library was built? Should i change it in the new version? |
I tend to use
for |
Thanks everyone! From my view also code generation is on the table.
I hope to do some tests and ideally make a decision and lay out what help
we might need early January.
|
@christian-korneck any update on Python 3.8 support ? |
any progress? @christian-korneck |
not at this time, apologies. I’m exceptionally busy with something else. However, to avoid misunderstandings, this project is not abandoned and I’m looking forward to make this change. |
Currently only Python 3.7 is supported. This is because the Python3 C API slightly changes between versions. For example Python 3.8 removed the
PyEval_ReInitThreads
function, so binding it fails. (Also sometimes new functions get added).We should add support for multiple Python versions. This should happen in a way that we don't just delete the functions that aren't supported in newer Python versions anymore (as this would be a breaking change for users of older Python versions).
If breaking changes are unavoidable, this should lead to a new major version.
The text was updated successfully, but these errors were encountered: