Equivalent to CPython's PyType_Check macro Checks if obj is an instance of type (or its subclass)
(obj: &PyObject)
| 555 | /// Equivalent to CPython's PyType_Check macro |
| 556 | /// Checks if obj is an instance of type (or its subclass) |
| 557 | pub(crate) fn check(obj: &PyObject) -> Option<&Py<Self>> { |
| 558 | obj.downcast_ref::<Self>() |
| 559 | } |
| 560 | |
| 561 | fn resolve_mro(bases: &[PyRef<Self>]) -> Result<Vec<PyTypeRef>, String> { |
| 562 | // Check for duplicates in bases. |