From adef6c66e29162e7e9763239eb50e070a21f4092 Mon Sep 17 00:00:00 2001 From: Bakyt Niiazaliev Date: Sat, 14 Jun 2025 10:59:12 +0700 Subject: [PATCH] fix: update __repr__ method in QueryParams to return class name dynamically --- src/urls.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/urls.rs b/src/urls.rs index 2db81433..82f92bd4 100644 --- a/src/urls.rs +++ b/src/urls.rs @@ -211,8 +211,9 @@ impl QueryParams { } } - pub fn __repr__(&self) -> String { - format!("QueryParams('{}')", self) + pub fn __repr__(slf: &Bound<'_, Self>) -> PyResult { + let class_name = slf.get_type().qualname()?; + Ok(format!("{}('{}')", class_name, slf)) } #[allow(unused_variables)]