summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-03-01 00:06:15 +1100
committerDamien George <damien.p.george@gmail.com>2020-03-26 01:21:04 +1100
commitf8fc78691d4ee401184a62b7974ebdc8f16850ab (patch)
tree0d9425f7cc15fed8a804572209034f98fe643628
parentc5cc64175be32cb1e4f3f1a249667bc9f5a12613 (diff)
py/mpconfig.h: Enable MICROPY_MODULE_GETATTR by default.
To enable lazy loading of submodules (among other things), which is very useful for MicroPython libraries that want to have optional subcomponents. Disabled explicitly on minimal ports.
-rw-r--r--ports/bare-arm/mpconfigport.h1
-rw-r--r--ports/minimal/mpconfigport.h1
-rw-r--r--py/mpconfig.h2
3 files changed, 3 insertions, 1 deletions
diff --git a/ports/bare-arm/mpconfigport.h b/ports/bare-arm/mpconfigport.h
index 273e21451..456767658 100644
--- a/ports/bare-arm/mpconfigport.h
+++ b/ports/bare-arm/mpconfigport.h
@@ -43,6 +43,7 @@
#define MICROPY_PY_STRUCT (0)
#define MICROPY_PY_SYS (0)
#define MICROPY_CPYTHON_COMPAT (0)
+#define MICROPY_MODULE_GETATTR (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
#define MICROPY_USE_INTERNAL_PRINTF (0)
diff --git a/ports/minimal/mpconfigport.h b/ports/minimal/mpconfigport.h
index 41e22cd01..2507d0124 100644
--- a/ports/minimal/mpconfigport.h
+++ b/ports/minimal/mpconfigport.h
@@ -55,6 +55,7 @@
#define MICROPY_PY_SYS (0)
#define MICROPY_MODULE_FROZEN_MPY (1)
#define MICROPY_CPYTHON_COMPAT (0)
+#define MICROPY_MODULE_GETATTR (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 371f2ce03..c5829a3e0 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -729,7 +729,7 @@ typedef double mp_float_t;
// Whether to support module-level __getattr__ (see PEP 562)
#ifndef MICROPY_MODULE_GETATTR
-#define MICROPY_MODULE_GETATTR (0)
+#define MICROPY_MODULE_GETATTR (1)
#endif
// Whether module weak links are supported