summaryrefslogtreecommitdiff
path: root/py/objmodule.c
AgeCommit message (Collapse)Author
2014-01-22py: Initialise loaded_module map in rt_init.Damien George
STM port crashes without this re-init. There should not be any state in the core py/ code that relies on pre-initialised data.
2014-01-22Second stage of qstr revamp: uPy str object can be qstr or not.Damien George
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-20Implement modules as singletons Python semantics.Paul Sokolovsky
In Python, importing module several times returns same underlying module object. This also fixes import statement handling for builtin modules. There're still issues: 1. CPython exposes set of loaded modules as sys.modules, we may want to do that either. 2. Builtin modules are implicitly imported, which is not really correct. We should separate registering a (builtin) module and importing a module. CPython keeps builtin module names in sys.builtin_module_names .
2014-01-18Make VM stack grow upwards, and so no reversed args arrays.Damien George
Change state layout in VM so the stack starts at state[0] and grows upwards. Locals are at the top end of the state and number downwards. This cleans up a lot of the interface connecting the VM to C: now all functions that take an array of Micro Python objects are in order (ie no longer in reverse). Also clean up C API with keyword arguments (call_n and call_n_kw replaced with single call method that takes keyword arguments). And now make_new takes keyword arguments. emitnative.c has not yet been changed to comply with the new order of stack layout.
2014-01-15type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky
2014-01-09Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.Damien George
Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
2014-01-08py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.Damien George
2014-01-07py: Fix allocation of unique code blocks.Damien George
2014-01-07Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George
ian-v-cplusplus Conflicts: py/objcomplex.c
2014-01-06Co-exist with C++ (issue #85)ian-v
2014-01-05Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky
2014-01-04Convert Python types to proper Python type hierarchy.Damien George
Now much more inline with how CPython does types.
2014-01-02Add module object, to be used eventually for import.Damien George