From ecb4e7ed82d50d163aff20992d93c588c5e5c0b5 Mon Sep 17 00:00:00 2001 From: volubepossum Date: Sat, 7 Mar 2026 22:58:07 +0100 Subject: [PATCH 1/2] Add exposure to the value and unit --- si-units/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/si-units/src/lib.rs b/si-units/src/lib.rs index 9067b22..59a7435 100644 --- a/si-units/src/lib.rs +++ b/si-units/src/lib.rs @@ -275,6 +275,17 @@ impl PySIObject { })? } } + + #[getter] + fn unit(&self) -> [i8; 7] { + self.unit.0 + } + + #[getter] + fn value(&self, py: Python) -> Py { + // self.value.clone_ref(py) + self.value.clone_ref(py) + } } #[derive(Clone, Copy)] From 706145c6ace182866622b6ada247fb16906b0169 Mon Sep 17 00:00:00 2001 From: volubepossum Date: Sat, 7 Mar 2026 23:08:47 +0100 Subject: [PATCH 2/2] fix: remove commented duplicate line --- si-units/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/si-units/src/lib.rs b/si-units/src/lib.rs index 59a7435..1b6d921 100644 --- a/si-units/src/lib.rs +++ b/si-units/src/lib.rs @@ -283,7 +283,6 @@ impl PySIObject { #[getter] fn value(&self, py: Python) -> Py { - // self.value.clone_ref(py) self.value.clone_ref(py) } }