mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Merge c230777e92
into 1f8b4a7f1a
This commit is contained in:
commit
cddec01946
@ -760,6 +760,15 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
/// NumPy array type char
|
||||
char type() const { return detail::array_descriptor_proxy(m_ptr)->type; }
|
||||
|
||||
/// NumPy array type num
|
||||
int type_num() const { return detail::array_descriptor_proxy(m_ptr)->type_num; }
|
||||
|
||||
/// NumPy array element size
|
||||
int elsize() const { return detail::array_descriptor_proxy(m_ptr)->elsize; }
|
||||
|
||||
private:
|
||||
static object &_dtype_from_pep3118() {
|
||||
PYBIND11_CONSTINIT static gil_safe_call_once_and_store<object> storage;
|
||||
@ -965,6 +974,9 @@ public:
|
||||
/// Return the NumPy array flags
|
||||
int flags() const { return detail::array_proxy(m_ptr)->flags; }
|
||||
|
||||
/// Mutable NumPy array flags
|
||||
int &flags() { return detail::array_proxy(m_ptr)->flags; }
|
||||
|
||||
/// If set, the array is writeable (otherwise the buffer is read-only)
|
||||
bool writeable() const {
|
||||
return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_WRITEABLE_);
|
||||
|
Loading…
Reference in New Issue
Block a user