From be7a40bd0f9273515da7834fae804e3f404d68af Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Fri, 5 Sep 2025 09:51:05 -0600 Subject: [PATCH] Mark immutable pyclasses as frozen --- bindings/python/src/token.rs | 2 +- bindings/python/src/utils/regex.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/src/token.rs b/bindings/python/src/token.rs index 86e926028..72481c368 100644 --- a/bindings/python/src/token.rs +++ b/bindings/python/src/token.rs @@ -1,7 +1,7 @@ use pyo3::prelude::*; use tk::Token; -#[pyclass(module = "tokenizers", name = "Token")] +#[pyclass(module = "tokenizers", name = "Token", frozen)] #[derive(Clone)] pub struct PyToken { token: Token, diff --git a/bindings/python/src/utils/regex.rs b/bindings/python/src/utils/regex.rs index 16f706820..fafba844f 100644 --- a/bindings/python/src/utils/regex.rs +++ b/bindings/python/src/utils/regex.rs @@ -3,7 +3,7 @@ use pyo3::prelude::*; use tk::utils::SysRegex; /// Instantiate a new Regex with the given pattern -#[pyclass(module = "tokenizers", name = "Regex")] +#[pyclass(module = "tokenizers", name = "Regex", frozen)] pub struct PyRegex { pub inner: SysRegex, pub pattern: String,