Skip to content

For the project which mixing Rust code and Python code, how the namespace looks like? #1426

Answered by davidhewitt
evan0greenup asked this question in Q&A
Discussion options

You must be logged in to vote

Transferred to maturin as this is specific to project layout when using maturin.

When using mixed Python / Rust in this way the my_project/__init__.py will control exactly the namespace you want.

maturin will package your Rust module beside this one, e.g. if your Rust library is my_project then you can import from it in the__init__.py as if you had my_project/my_project.py.

(Actually because it is compiled code, the file will be my_project.soor similar depending on OS but it functions the same.)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by messense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants