summaryrefslogtreecommitdiffstatshomepage
path: root/py/objmodule.c
Commit message (Collapse)AuthorAge
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* Proper support for registering builtin modules in ROM.Damien George2014-03-25
| | | | | Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].
* Add mp_obj_module_registermux2014-03-25
| | | | | * Add function to load static modules. * Use module_register to pyb module.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* Implement ROMable modules. Add math module.Damien George2014-03-08
| | | | | | | | | | mp_module_obj_t can now be put in ROM. Configuration of float type is now similar to longint: can now choose none, float or double as the implementation. math module has basic math functions. For STM port, these are not yet implemented (they are just stub functions).
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
* Change mp_obj_type_t.name from const char * to qstr.Damien George2014-02-15
| | | | | | Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.Paul Sokolovsky2014-02-12
| | | | | | | | Some tools do not support local/static symbols (one example is GNU ld map file). Exposing all functions will allow to do detailed size comparisons, etc. Also, added bunch of statics where they were missing, and replaced few identity functions with global mp_identity().
* Search paths properly on import and execute __init__.py if it exists.Damien George2014-02-05
|
* py: Initialise loaded_module map in rt_init.Damien George2014-01-22
| | | | | STM port crashes without this re-init. There should not be any state in the core py/ code that relies on pre-initialised data.
* Second stage of qstr revamp: uPy str object can be qstr or not.Damien George2014-01-22
|
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* Implement modules as singletons Python semantics.Paul Sokolovsky2014-01-20
| | | | | | | | | | | | 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 .
* Make VM stack grow upwards, and so no reversed args arrays.Damien George2014-01-18
| | | | | | | | | | | | | | | 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.
* type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky2014-01-15
|
* Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.Damien George2014-01-09
| | | | | Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
* py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.Damien George2014-01-08
|
* py: Fix allocation of unique code blocks.Damien George2014-01-07
|
* Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George2014-01-07
|\ | | | | | | | | | | | | ian-v-cplusplus Conflicts: py/objcomplex.c
| * Co-exist with C++ (issue #85)ian-v2014-01-06
|/
* Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky2014-01-05
|
* Convert Python types to proper Python type hierarchy.Damien George2014-01-04
| | | | Now much more inline with how CPython does types.
* Add module object, to be used eventually for import.Damien George2014-01-02