Skip to content

Commit

Permalink
Mark immutable Python shim types frozen for better perf. (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi authored Sep 18, 2024
1 parent f85f6a6 commit 5589ad7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytrustfall/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn register(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()>
Ok(())
}

#[pyclass]
#[pyclass(frozen)]
pub struct Schema {
inner: trustfall_core::schema::Schema,
}
Expand Down Expand Up @@ -126,7 +126,7 @@ fn make_iterator<'py>(value: &Bound<'py, PyAny>, origin: &'static str) -> Bound<
value.iter().unwrap_or_else(|e| panic!("{origin} is not an iterable: {e}"))
}

#[pyclass(unsendable)]
#[pyclass(unsendable, frozen)]
#[derive(Debug, Clone)]
pub(crate) struct Opaque {
data: *mut (),
Expand Down

0 comments on commit 5589ad7

Please sign in to comment.