Add more pyo3 interfaces

Thu, 26 Feb 2026 05:00:09 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 26 Feb 2026 05:00:09 -0500
changeset 6
aefacd832408
parent 5
e781c543e228
child 7
c75d63bc2904

Add more pyo3 interfaces

src/python.rs file | annotate | diff | comparison | revisions
--- a/src/python.rs	Sat Jan 24 19:24:29 2026 -0500
+++ b/src/python.rs	Thu Feb 26 05:00:09 2026 -0500
@@ -130,6 +130,16 @@
             }
         }
 
+        impl<'a, 'py> IntoPyObject<'py> for &'a DiscreteMeasure<Loc<$N, $F>, $F> {
+            type Target = $name;
+            type Error = PyErr;
+            type Output = Bound<'py, $name>;
+
+            fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
+                Bound::new(py, $name { inner: self.clone() })
+            }
+        }
+
         impl<'py> IntoPyObject<'py> for DiscreteMeasure<Loc<$N, $F>, $F> {
             type Target = $name;
             type Error = PyErr;

mercurial