mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-16 21:57:55 +00:00
Compare commits
10 Commits
9e511077c3
...
be55c559f2
Author | SHA1 | Date | |
---|---|---|---|
|
be55c559f2 | ||
|
c230777e92 | ||
|
f6fc661a5e | ||
|
7a78222b69 | ||
|
49668e5e57 | ||
|
9ef681765d | ||
|
6b0a4e8510 | ||
|
142ae7e124 | ||
|
3f0f27fc12 | ||
|
5cf262c762 |
@ -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