Comments (3)
Please have a look at https://pyo3.rs/v0.21.1/faq#pyo3get-clones-my-field
The property x.object_one
as generated by get_all
will return a copy of the field which is possibly why you had to add #[derive(Clone)]
to TestStruct
in the first place.
If you want to share ownership of object_one
with Python code, you need to wrap it with a Py
smart pointer.
from pyo3.
It seems as though you are right, this is entirely my misunderstanding. Thank you for clarifying and I apologize for the noise!
from pyo3.
Thank you for clarifying and I apologize for the noise!
Don't worry about it. We are all learning together.
from pyo3.
Related Issues (20)
- Add support for Python interpreter version 3.13 - PyCharm HOT 1
- Implement `PartialEq` for more `Bound<'py, T>` types HOT 9
- Performance opportunity: support `__vectorcalloffset__` for `__call__`
- Contribution opportunity: use Python 3.12 managed dict and weakref
- RFC: rename `PyString` -> `PyStr`, and `PyLong` -> `PyInt` HOT 12
- Emit `c""` literals from macros on Rust 1.77+
- Linking error on macOS when using pyo3_special_method_derive
- Tracking issue for no-gil/freethreaded work HOT 1
- Proc macro to create .pyi file from rust implementations
- Confusing error messages with invalid `PYO3_CROSS_LIB_DIR` HOT 2
- Compilation error on MacOS (both arm64 and x86_64) with Python 3.11.6 & Rust 1.79.0 installed via asdf HOT 1
- Defining `pymethods` in a different module silently fails
- Failed to run on M1 with anaconda? HOT 1
- Declarative modules submodules don't work with `#[pyo3::prelude::pymodule]` HOT 2
- Declarative modules: submodule declarations are not considered covered HOT 7
- many 128-bit number conversion tests fail on s390x-unknown-linux-gnu (big-endian)
- 'Deprecation of implicit default for trailing optional arguments' Causing issues with erasable setters HOT 1
- support scipy csc matrix
- `SIGSEGV: invalid memory reference` in tests, but only when running them simultanously HOT 1
- Opt in to Unit Variants for Complex Enums with the `sealedclass` attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyo3.