Skip to content

Commit 61ce229

Browse files
committed
Update the docstring for Element
1 parent 2e2b576 commit 61ce229

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/dtype.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ impl PyArrayDescr {
107107
///
108108
/// # Safety
109109
///
110-
/// A type `T` that implements this trait should be safe when managed in numpy array,
111-
/// thus implementing this trait is marked unsafe.
112-
/// This means that all data types except for `DataType::Object` are assumed to be trivially copyable.
113-
/// Furthermore, it is assumed that for `DataType::Object` the elements are pointers into the Python heap
114-
/// and that the corresponding `Clone` implemenation will never panic as it only increases the reference count.
110+
/// A type `T` that implements this trait should be safe when managed in numpy
111+
/// array, thus implementing this trait is marked unsafe. Data types that don't
112+
/// contain Python objects (i.e., either the object type itself or record types
113+
/// containing object-type fields) are assumed to be trivially copyable, which
114+
/// is reflected in the `IS_COPY` flag. Furthermore, it is assumed that for
115+
/// the object type the elements are pointers into the Python heap and that the
116+
/// corresponding `Clone` implemenation will never panic as it only increases
117+
/// the reference count.
115118
///
116119
/// # Custom element types
117120
///

0 commit comments

Comments
 (0)