Bruno Kolenbrander
Bruno Kolenbrander
Closing in favour of https://github.com/PyO3/pyo3/pull/2549
The guide has a [paragraph on inheritance](https://pyo3.rs/v0.13.2/class.html#inheritance) with an example that looks like what you are trying to do. But this seems like a weird thing to use inheritance for...
> I disagree. It's very common in Python to use subclasses for what we use an enum in Rust. Oh, like the factory pattern in Java? That does make sense...
> If anyone gets a chance to verify this It looks that way. Is there a way we can insert this attribute ourselves rather than having users use it? It...
I worked around this by creating a proc macro that inserts `#[pyo3(get)]` for every field: ```rust #[cfg_attr(feature = "pyo3", macro_utils::pyo3_get_all)] #[cfg_attr(feature = "pyo3", pyclass)] #[derive(Serialize, Clone, Debug, Default)] pub struct...
@andyblarblar see https://github.com/mejrs/rs3cache/blob/master/rs3cache_macros/src/lib.rs Note that functionality like `#[pyclass(get_all, set_all)]` is still something I want to add to pyo3 :)
Acquiring an uncontested mutex is really cheap. I think you're overestimating the overhead associated with that. Especially the difference between it and a RefCell, and the relative costs when things...
I don't think the current situation is so bad. I'm inclined to do nothing with default arguments, and let users handle it themselves: ```rust fn foo(a: i32, b: i32, c:...
I still see it in the CI logs. (for example, [here](https://github.com/PyO3/pyo3/runs/7761038831?check_suite_focus=true#step:15:122))
I imagine we would want these as associated methods like std's guards. It would be called like ```rust #[pymethods] impl Example { pub fn inner(mut slf: PyRefMut { PyRefMut::map(slf, |val|...