summaryrefslogtreecommitdiffstatshomepage
path: root/py/objnamedtuple.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-10 22:42:11 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-10 22:42:11 +0100
commit57e99ebc868aeaae3b0f826beef7f82c01e56405 (patch)
tree46a7c6b34675920960e79873d9995cfd9226319f /py/objnamedtuple.c
parentae491055fae927dbdfabeea69ffee166a9720a68 (diff)
downloadmicropython-57e99ebc868aeaae3b0f826beef7f82c01e56405.tar.gz
micropython-57e99ebc868aeaae3b0f826beef7f82c01e56405.zip
py: Add simple way of looking up constants in compiler.
Working towards trying to support compile-time constants (see discussion in issue #227), this patch allows the compiler to look inside arbitrary uPy objects at compile time. The objects to search are given by the macro MICROPY_EXTRA_CONSTANTS (so they must be constant/ROM objects), and the constant folding occures on forms base.attr (both base and attr must be id's). It works, but it breaks strict CPython compatibility, since the lookup will succeed even without importing the namespace.
Diffstat (limited to 'py/objnamedtuple.c')
0 files changed, 0 insertions, 0 deletions