MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / is_base_string

Function is_base_string

src/objects/string.rs:96–103  ·  view source on GitHub ↗
(obj: &PyObject)

Source from the content-addressed store, hash-verified

94#[cfg(feature = "python27-sys")]
95#[inline]
96fn is_base_string(obj: &PyObject) -> bool {
97 unsafe {
98 ffi::PyType_FastSubclass(
99 ffi::Py_TYPE(obj.as_ptr()),
100 ffi::Py_TPFLAGS_STRING_SUBCLASS | ffi::Py_TPFLAGS_UNICODE_SUBCLASS,
101 ) != 0
102 }
103}
104
105#[cfg(feature = "python27-sys")]
106impl crate::python::PythonObjectWithTypeObject for PyString {

Callers 2

downcast_fromMethod · 0.85
downcast_borrow_fromMethod · 0.85

Calls 3

PyType_FastSubclassFunction · 0.50
Py_TYPEFunction · 0.50
as_ptrMethod · 0.45

Tested by

no test coverage detected