diff options
author | Damien George <damien.p.george@gmail.com> | 2014-12-09 16:19:48 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-12-09 16:19:48 +0000 |
commit | 78d702c300ae9f175e6f47f805a37cdfe5b81898 (patch) | |
tree | 034b42ea789dc38c629a2f0dd8a48001a32cd838 /unix/mpconfigport.h | |
parent | e6e8ad8ab238cd596a3eedf8f4dd635e2e84f46e (diff) | |
download | micropython-78d702c300ae9f175e6f47f805a37cdfe5b81898.tar.gz micropython-78d702c300ae9f175e6f47f805a37cdfe5b81898.zip |
py: Allow builtins to be overridden.
This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS)
which, when enabled, allows to override all names within the builtins
module. A builtins override dict is created the first time the user
assigns to a name in the builtins model, and then that dict is searched
first on subsequent lookups. Note that this implementation doesn't
allow deleting of names.
This patch also does some refactoring of builtins code, creating the
modbuiltins.c file.
Addresses issue #959.
Diffstat (limited to 'unix/mpconfigport.h')
-rw-r--r-- | unix/mpconfigport.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index e08da770ad..51d100b722 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -44,6 +44,7 @@ #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_OPT_COMPUTED_GOTO (1) +#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_PY_BUILTINS_STR_UNICODE (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) #define MICROPY_PY_BUILTINS_FROZENSET (1) |