@@ -110,6 +110,7 @@ pyobject_native_type_convert!(
110110) ;
111111
112112pyobject_native_type_named ! ( PyArray <T , D >, T , D ) ;
113+ pyobject_native_type_fmt ! ( PyArray <T , D >, T , D ) ;
113114
114115impl < ' a , T , D > std:: convert:: From < & ' a PyArray < T , D > > for & ' a PyAny {
115116 fn from ( ob : & ' a PyArray < T , D > ) -> Self {
@@ -131,7 +132,7 @@ impl<'a, T: Element, D: Dimension> FromPyObject<'a> for &'a PyArray<T, D> {
131132 fn extract ( ob : & ' a PyAny ) -> PyResult < Self > {
132133 let array = unsafe {
133134 if npyffi:: PyArray_Check ( ob. as_ptr ( ) ) == 0 {
134- return Err ( PyDowncastError . into ( ) ) ;
135+ return Err ( PyDowncastError :: new ( ob , "PyArray<T, D>" ) . into ( ) ) ;
135136 }
136137 & * ( ob as * const PyAny as * const PyArray < T , D > )
137138 } ;
@@ -206,7 +207,7 @@ impl<T, D> PyArray<T, D> {
206207 ///
207208 /// # Example
208209 /// ```
209- /// use pyo3::{GILGuard, Python, Py, AsPyRef };
210+ /// use pyo3::{GILGuard, Python, Py};
210211 /// use numpy::PyArray1;
211212 /// fn return_py_array() -> Py<PyArray1<i32>> {
212213 /// let gil = Python::acquire_gil();
0 commit comments