summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2019-05-08 16:16:17 +0200
committerDamien George <damien.p.george@gmail.com>2019-05-14 17:15:17 +1000
commit90fae9172a67f44e1fac967f628f26ddf90da963 (patch)
treebd6b6fabc10c1e0cd8100494860ffa722698ca03 /py/mpconfig.h
parent38cb95710a97fe65e901043ff435d4e3a90530e4 (diff)
py/objarray: Add support for memoryview.itemsize attribute.
This allows figuring out the number of bytes in the memoryview object as len(memview) * memview.itemsize. The feature is enabled via MICROPY_PY_BUILTINS_MEMORYVIEW_ITEMSIZE and is disabled by default.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 38b36a4b1..2d857d8f6 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -856,6 +856,11 @@ typedef double mp_float_t;
#define MICROPY_PY_BUILTINS_MEMORYVIEW (0)
#endif
+// Whether to support memoryview.itemsize attribute
+#ifndef MICROPY_PY_BUILTINS_MEMORYVIEW_ITEMSIZE
+#define MICROPY_PY_BUILTINS_MEMORYVIEW_ITEMSIZE (0)
+#endif
+
// Whether to support set object
#ifndef MICROPY_PY_BUILTINS_SET
#define MICROPY_PY_BUILTINS_SET (1)