fn extract(ob: &'a PyObjectRef) -> PyResult<Self> {
        let array = unsafe {
            if npyffi::PyArray_Check(ob.as_ptr()) == 0 {
                return Err(PyDowncastError.into());
            }
            &*(ob as *const PyObjectRef as *const PyArray<T, D>)
        };
        array
            .type_check()
            .map(|_| array)
            .into_pyresult_with(|| "[FromPyObject::extract] typecheck failed")
    }
// here we do type-check three times
// 1. Checks if the object is PyArray
// 2. Checks if the data type of the array is T
// 3. Checks if the dimension is same as D
here we do type-check three times
1. Checks if the object is PyArray
2. Checks if the data type of the array is T
3. Checks if the dimension is same as D
here we do type - check three times 1 . Checks if the object is PyArray 2 . Checks if the data type of the array is T 3 . Checks if the dimension is same as D
fn extract(ob: &'a PyObjectRef) -> PyResult<Self> {
        let array = unsafe {
            if npyffi::PyArray_Check(ob.as_ptr()) == 0 {
                return Err(PyDowncastError.into());
            }
            &*(ob as *const PyObjectRef as *const PyArray<T, D>)
        };
        array
            .type_check()
            .map(|_| array)
            .into_pyresult_with(|| "[FromPyObject::extract] typecheck failed")
    }
fn extract ( ob : & ' a PyObjectRef ) -> PyResult < Self > { let array = unsafe { if npyffi :: PyArray_Check ( ob . as_ptr ( ) ) == 0 { return Err ( PyDowncastError . into ( ) ) ; } & * ( ob as * const PyObjectRef as * const PyArray < T , D > ) } ; array . type_check ( ) . map ( | _ | array ) . into_pyresult_with ( | | " " ) }
here we do type-check three times
1.
here we do type - check three times 1 .
ob
&'a PyObjectRef
ob
&'a PyObjectRef