Skip to content

Rust python bindings with PyO3: TypeError: argument 'qr': 'QR2d' object cannot be converted to 'QR2d' #3244

Discussion options

You must be logged in to vote

Does anyone know why this is?

Type objects are currently private to each extension due to the linkage model of Rust, i.e. static linking without a stable ABI. Hence the QR2d type from lb_py is a different type than the QR2d type from types_py.

The easiest way around that is have only one Rust extension and limit reuse to within the Rust code.

Other ways like capsule API as used by other native extensions written in e.g. C/C++ are possible but more involved and currently nothing specifically helpful for Rust/PyO3 exists.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davidhewitt
Comment options

@JustinLiang
Comment options

@JustinLiang
Comment options

Answer selected by JustinLiang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants