#[macro_export]
macro_rules! impl_repr {
($($name:ident),* $(,)?) => {
$(
$crate::maybe_add_cfg_stubs_gen_stub_pymethods! {
#[$crate::pyo3::pymethods]
impl $name {
pub fn __repr__(&self) -> String {
format!("{self:?}")
}
}
}
)*
};
}
#[cfg(not(feature = "stubs"))]
#[doc(hidden)]
#[macro_export]
macro_rules! maybe_add_cfg_stubs_gen_stub_pymethods {
($($body:tt)*) => {
$($body)*
}
}
#[cfg(feature = "stubs")]
#[doc(hidden)]
#[macro_export]
macro_rules! maybe_add_cfg_stubs_gen_stub_pymethods {
($($body:tt)*) => {
#[cfg_attr(feature = "stubs", $crate::pyo3_stub_gen::derive::gen_stub_pymethods)]
$($body)*
}
}