We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem
❌ Fails - due to PyO3/pyo3#1003
#[cfg(feature = "python")] use pyo3::prelude::*; #[cfg_attr(feature = "python", pyo3_stub_gen::gen_stub_pyclass)] #[cfg_attr(feature = "python", pyo3::pyclass)] #[derive(Clone)] pub struct Dimensions { #[pyo3(get, set)] pub length: f64, #[pyo3(get, set)] pub width: f64, #[pyo3(get, set)] pub height: f64, }
❌ Fails - note the pyo3:: prefix in pyo3::pyclass
pyo3::
pyo3::pyclass
#[cfg_attr(feature = "python", pyo3_stub_gen::gen_stub_pyclass)] #[cfg_attr(feature = "python", pyo3::pyclass(get_all,set_all)] #[derive(Clone)] pub struct Dimensions { pub length: f64, pub width: f64, pub height: f64, }
✅ Succeeds:
#[cfg(feature = "python")] use pyo3::prelude::*; #[cfg_attr(feature = "python", pyo3_stub_gen::gen_stub_pyclass)] #[cfg_attr(feature = "python", pyclass(get_all, set_all))] #[derive(Clone)] pub struct Dimensions { pub length: f64, pub width: f64, pub height: f64, }
Expected
It works in all three cases.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
❌ Fails - due to PyO3/pyo3#1003
❌ Fails - note the
pyo3::
prefix inpyo3::pyclass
✅ Succeeds:
Expected
It works in all three cases.
The text was updated successfully, but these errors were encountered: