Skip to content

Commit

Permalink
feat(pyargus): add __str__ methods for Expr
Browse files Browse the repository at this point in the history
  • Loading branch information
anand-bala committed Oct 13, 2023
1 parent 69daf21 commit fb72e60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyargus/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ impl PyNumExpr {
format!("{:?}", &self.0)
}

fn __str__(&self) -> String {
format!("{}", self.0)
}

fn __neg__(&self) -> PyResult<Py<Negate>> {
Python::with_gil(|py| Py::new(py, Negate::new(self.clone())))
}
Expand Down Expand Up @@ -308,6 +312,10 @@ impl PyBoolExpr {
format!("{:?}", &self.0)
}

fn __str__(&self) -> String {
format!("{}", self.0)
}

fn __invert__(&self) -> PyResult<Py<Not>> {
Python::with_gil(|py| Py::new(py, Not::new(self.clone())))
}
Expand Down

0 comments on commit fb72e60

Please sign in to comment.