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
[needs-design]Can we let macro generate function to append module to init table? #2359
Comments
herquan
changed the title
Can we let macro generate function to append module to init table?
[needs-design]Can we let macro generate function to append module to init table?
May 5, 2022
I would be ok with having a safe function |
Actually maybe this would need to a a macro |
herquan
added a commit
to herquan/pyo3
that referenced
this issue
May 9, 2022
Sometimes we need to debug in a real environment with our module installed. `append_to_inittab` will be a wrapper for PyImport_AppendInittab (https://docs.python.org/3/c-api/import.html#c.PyImport_AppendInittab) and help us to do this
herquan
added a commit
to herquan/pyo3
that referenced
this issue
May 9, 2022
Sometimes we need to debug in a real environment with our module installed. `append_to_inittab` will be a wrapper for PyImport_AppendInittab (https://docs.python.org/3/c-api/import.html#c.PyImport_AppendInittab) and help us to do this
herquan
added a commit
to herquan/pyo3
that referenced
this issue
May 10, 2022
Sometimes we need to debug in a real environment with our module installed. `append_to_inittab` will be a wrapper for PyImport_AppendInittab (https://docs.python.org/3/c-api/import.html#c.PyImport_AppendInittab) and help us to do this
davidhewitt
added a commit
that referenced
this issue
May 24, 2022
Add macro append_to_inittab (issue #2359)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
In order to debug module sometimes we need to run a python script inside the rust environment. One way to do this is through calling function PyImport_AppendInittab before pyo3::prepare_freethreaded_python(). We don't have this in pyo3 directly but one workaround would be adding such piece of code
And I'm thinking of adding such support in macro pymodule with similar code like
Meanwhile make sure PyImport_AppendInittab contains unsafe so this function can be reused. One thing I'm not sure is how to let the rust project that uses pyo3 recognize the
append_inittab_wrapper
without guessing the function name.Please let me know if there is any concern for this or if there is any better idea?
The text was updated successfully, but these errors were encountered: