@@ -259,10 +259,6 @@ impl DataType {
259
259
/// unsafe impl Element for Wrapper {
260
260
/// const DATA_TYPE: DataType = DataType::Object;
261
261
///
262
- /// fn is_same_type(dtype: &PyArrayDescr) -> bool {
263
- /// dtype.get_datatype() == Some(DataType::Object)
264
- /// }
265
- ///
266
262
/// fn get_dtype(py: Python) -> &PyArrayDescr {
267
263
/// PyArrayDescr::object(py)
268
264
/// }
@@ -280,9 +276,6 @@ pub unsafe trait Element: Clone + Send {
280
276
/// `DataType` corresponding to this type.
281
277
const DATA_TYPE : DataType ;
282
278
283
- /// Returns if the give `dtype` is convertible to `Self` in Rust.
284
- fn is_same_type ( dtype : & PyArrayDescr ) -> bool ;
285
-
286
279
/// Create `dtype`.
287
280
fn get_dtype ( py : Python ) -> & PyArrayDescr ;
288
281
}
@@ -292,10 +285,6 @@ macro_rules! impl_num_element {
292
285
unsafe impl Element for $ty {
293
286
const DATA_TYPE : DataType = $data_type;
294
287
295
- fn is_same_type( dtype: & PyArrayDescr ) -> bool {
296
- dtype. get_datatype( ) == Some ( $data_type)
297
- }
298
-
299
288
fn get_dtype( py: Python ) -> & PyArrayDescr {
300
289
PyArrayDescr :: from_npy_type( py, $data_type. into_npy_type( ) )
301
290
}
@@ -328,10 +317,6 @@ cfg_if! {
328
317
unsafe impl Element for PyObject {
329
318
const DATA_TYPE : DataType = DataType :: Object ;
330
319
331
- fn is_same_type ( dtype : & PyArrayDescr ) -> bool {
332
- dtype. get_typenum ( ) == NPY_TYPES :: NPY_OBJECT as i32
333
- }
334
-
335
320
fn get_dtype ( py : Python ) -> & PyArrayDescr {
336
321
PyArrayDescr :: object ( py)
337
322
}
0 commit comments