diff --git a/pyargus/src/semantics.rs b/pyargus/src/semantics.rs index 4da47b4..fb02fa5 100644 --- a/pyargus/src/semantics.rs +++ b/pyargus/src/semantics.rs @@ -82,21 +82,15 @@ impl Trace for PyTrace { } } -#[pyclass(name = "BooleanSemantics")] -struct PyBooleanSemantics; - -#[pymethods] -impl PyBooleanSemantics { - #[staticmethod] - fn eval(expr: &PyBoolExpr, trace: &PyTrace) -> PyResult> { - let sig = BooleanSemantics::eval(&expr.0, trace, ()).map_err(PyArgusError::from)?; - Python::with_gil(|py| Py::new(py, (BoolSignal::from(sig), BoolSignal::super_type()))) - } +#[pyfunction] +fn eval_bool_semantics(expr: &PyBoolExpr, trace: &PyTrace) -> PyResult> { + let sig = BooleanSemantics::eval(&expr.0, trace, ()).map_err(PyArgusError::from)?; + Python::with_gil(|py| Py::new(py, (BoolSignal::from(sig), BoolSignal::super_type()))) } pub fn init(_py: Python, m: &PyModule) -> PyResult<()> { - m.add_class::()?; m.add_class::()?; + m.add_function(wrap_pyfunction!(eval_bool_semantics, m)?)?; Ok(()) }