-
Notifications
You must be signed in to change notification settings - Fork 765
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
request for sample test-cases for python-types -> rust codegen #981
Comments
Hi @devdoomari3, thanks for posting the issue, What you're asking for is pretty open ended, and pyo3 maintainers are short enough on time already so I don't think we'll be likely to write you a list of examples any time soon. Instead, if you write in this issue any Python examples for which you are unsure what the Rust code should be, I'm happy to discuss possible transformations with you. For example, your function taking a Rust class:
This should probably be
And then you could use |
@davidhewitt thanks for the example! sorry for adding burden on PyO3 🙏 anyway, this issue isn't urgent (it's just a hobby project for now), but I'm hoping to keep this issue open so some passersby can add comments here ps:
does that mean I have to read body of python-function ( |
Ah sorry I misread, you're just generating the definitions, not the function bodies. So |
As this issue is a question with no activity for a couple of months, I'm going to close it to keep the issue tracker tidy. |
Hello!
I made python-codegen to extract function-signatures/etc for code-generation
https://github.com/pycodegen/python-codegen
(python -> typescript example: https://github.com/pycodegen/python-codegen/tree/develop/py_codegen/plugins/typescript )
I'm hoping to use this for generating rust-type definitions from python-files (python -> rust (pyO3) )
Could you give me sample cases so I can make test-cases from those?
(maybe strings / arrays / some unique python quirks to consider / etc)
examples:
this python-function should be converted to
should converts to:
and this python-function
should be converted to
and etc
thank you!
ps: this is the opposite of #510 issue
The text was updated successfully, but these errors were encountered: