We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PyArrayDescr::is_equiv_to()
1 parent 5f1b3b6 commit 612e867Copy full SHA for 612e867
src/dtype.rs
@@ -84,6 +84,11 @@ impl PyArrayDescr {
84
T::get_dtype(py)
85
}
86
87
+ /// Returns true if two type descriptors are equivalent.
88
+ pub fn is_equiv_to(&self, other: &Self) -> bool {
89
+ unsafe { PY_ARRAY_API.PyArray_EquivTypes(self.as_dtype_ptr(), other.as_dtype_ptr()) != 0 }
90
+ }
91
+
92
fn from_npy_type(py: Python, npy_type: NPY_TYPES) -> &Self {
93
unsafe {
94
let descr = PY_ARRAY_API.PyArray_DescrFromType(npy_type as _);
0 commit comments