Skip to content

Commit 14a19a7

Browse files
committed
Add __repr__ to PrintableString
Signed-off-by: Facundo Tuesca <[email protected]>
1 parent 8c1812c commit 14a19a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rust/src/declarative_asn1/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ impl PrintableString {
9191
pub fn as_str(&self, py: pyo3::Python<'_>) -> pyo3::PyResult<pyo3::Py<pyo3::types::PyString>> {
9292
Ok(self.inner.clone_ref(py))
9393
}
94+
95+
pub fn __repr__(&self) -> String {
96+
format!("PrintableString({})", self.inner)
97+
}
9498
}
9599

96100
/// Utility function for converting builtin Python types

0 commit comments

Comments
 (0)