Skip to main content

pyobject_native_type_info

Macro pyobject_native_type_info 

Source
#[doc(hidden)]
macro_rules! pyobject_native_type_info { ($name:ty, $typeobject:expr, $type_hint_module:expr, $type_hint_name:expr, $module:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => { ... }; }
Expand description

Implements the PyTypeInfo trait for a native Python type.

§Safety

  • $typeobject must be a function that produces a valid *mut PyTypeObject
  • $checkfunction must be a function that accepts arbitrary *mut PyObject and returns true / false according to whether the object is an instance of the type from $typeobject
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here