summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authordmazzella <damianomazzella@gmail.com>2017-01-03 11:00:12 +0100
committerDamien George <damien.p.george@gmail.com>2017-02-09 12:40:15 +1100
commit18e65691661ef8e83060d0e72d66b16cc918c8b4 (patch)
treed1d7f8b5d86c0119a061bf08d07ccec5d827f7c5 /py/mpconfig.h
parentec7dc7f8d796b5b67772d1f40863d13fb5e19be2 (diff)
downloadmicropython-18e65691661ef8e83060d0e72d66b16cc918c8b4.tar.gz
micropython-18e65691661ef8e83060d0e72d66b16cc918c8b4.zip
py/objtype: Implement __delattr__ and __setattr__.
This patch implements support for class methods __delattr__ and __setattr__ for customising attribute access. It is controlled by the config option MICROPY_PY_DELATTR_SETATTR and is disabled by default.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index afd9a0be5e..093625a461 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -635,6 +635,12 @@ typedef double mp_float_t;
#define MICROPY_PY_DESCRIPTORS (0)
#endif
+// Whether to support class __delattr__ and __setattr__ methods
+// This costs some code size and makes all del attrs and store attrs slow
+#ifndef MICROPY_PY_DELATTR_SETATTR
+#define MICROPY_PY_DELATTR_SETATTR (0)
+#endif
+
// Support for async/await/async for/async with
#ifndef MICROPY_PY_ASYNC_AWAIT
#define MICROPY_PY_ASYNC_AWAIT (1)