We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b05393 commit 076e2d8Copy full SHA for 076e2d8
tests/array.rs
@@ -104,3 +104,13 @@ fn iter_to_pyarray() {
104
println!("arr = {:?}", arr.as_slice::<i32>().unwrap());
105
assert_eq!(arr.shape(), [10]);
106
}
107
+
108
+#[test]
109
+fn is_instance() {
110
+ let gil = pyo3::Python::acquire_gil();
111
+ let py = gil.python();
112
+ let np = PyArrayModule::import(py).unwrap();
113
+ let arr = PyArray::new::<f64>(gil.python(), &np, &[3, 5]);
114
+ assert!(py.is_instance::<PyArray, _>(&arr).unwrap());
115
+ assert!(!py.is_instance::<pyo3::PyList, _>(&arr).unwrap());
116
+}
0 commit comments