macro_rules! type_hint_identifier {
("builtins", $name:expr) => { ... };
($module:expr, $name:expr) => { ... };
}Expand description
Builds a type hint from a module name and a member name in the module
use pyo3::type_hint_identifier;
use pyo3::inspect::PyStaticExpr;
const T: PyStaticExpr = type_hint_identifier!("datetime", "date");
assert_eq!(T.to_string(), "datetime.date");
const T2: PyStaticExpr = type_hint_identifier!("builtins", "int");
assert_eq!(T2.to_string(), "int");