MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / casting_works

Function casting_works

tests/array.rs:443–449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

441
442#[test]
443fn casting_works() {
444 Python::attach(|py| {
445 let ob = PyArray::from_slice(py, &[1_i32, 2, 3]).into_any();
446
447 assert!(ob.cast::<PyArray1<i32>>().is_ok());
448 });
449}
450
451#[test]
452fn casting_respects_element_type() {

Callers

nothing calls this directly

Calls 1

from_sliceFunction · 0.85

Tested by

no test coverage detected