Skip to content

Commit 4ed5d9d

Browse files
authored
Impl __repr__ for custom vector (#1314)
1 parent aea56cf commit 4ed5d9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/iterators.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ macro_rules! custom_vec_iter_impl {
546546
Python::with_gil(|py| Ok(format!("{}{}", stringify!($name), self.$data.str(py)?)))
547547
}
548548

549+
fn __repr__(&self) -> PyResult<String> {
550+
self.__str__()
551+
}
552+
549553
fn __hash__(&self) -> PyResult<u64> {
550554
let mut hasher = DefaultHasher::new();
551555
Python::with_gil(|py| PyHash::hash(&self.$data, py, &mut hasher))?;

0 commit comments

Comments
 (0)