summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* Add len() support for arrays.Paul Sokolovsky2014-01-21
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-01-21
|\ | | | | | | | | | | | | | | | | Conflicts: py/objstr.c py/py.mk py/stream.c unix/main.c unix/socket.c
| * Implement str.split(None).Paul Sokolovsky2014-01-21
| | | | | | | | Note that splitting by explicit string is not implemented so far.
| * str: Implement proper string (instead of byte string) indexing.Paul Sokolovsky2014-01-21
| | | | | | | | Also, support negative indexes.
| * Implement string multiplication.Paul Sokolovsky2014-01-21
| |
| * sequence.c: Start to refactor sequence operations for reuse among types.Paul Sokolovsky2014-01-21
| |
| * objstr: More support for MP_OBJ_QSTR.Paul Sokolovsky2014-01-20
| |
| * mp_obj_get_type_str(): Handle MP_OBJ_QSTR.Paul Sokolovsky2014-01-20
| |
| * Add dummy bytes() constructor.Paul Sokolovsky2014-01-20
| | | | | | | | | | | | Currently, MicroPython strings are mix between CPython byte and unicode strings. So, conversion is null so far. This dummy implementation is intended for compatibility with CPython (so, same code can run on both).
| * stream_read(): Shrink memory block to actual read size.Paul Sokolovsky2014-01-20
| |
| * stream: Add generic unbuffered iternext method.Paul Sokolovsky2014-01-20
| | | | | | | | Uses stream_unbuffered_readline underline.
| * mp_identity(): Add generic identity function.Paul Sokolovsky2014-01-20
| | | | | | | | Useful as getiter method for objects which are their own iterators, etc.
| * mp_obj_get_qstr(): Handle MP_OBJ_QSTR.Paul Sokolovsky2014-01-20
| |
* | 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
* py: Put micropython module init code in builtinmp.c.Damien George2014-01-20
|
* Expose memory stats functions via "micropython" module.Paul Sokolovsky2014-01-20
| | | | | | | These are micropython.mem_total(), .mem_current(), .mem_peak(). These are 3 individual functions with simple scalar return value to make sure that calls to these functions themselves have minimal (hopefully zero) impact on memory allocation.
* Don't implicitly import "sys" module.Paul Sokolovsky2014-01-20
|
* Pre-create sys module.Paul Sokolovsky2014-01-20
|
* Properly print MP_OBJ_QSTR objects.Paul Sokolovsky2014-01-20
|
* 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 .
* Change int to uint for n_args in function with variable arguments.Damien George2014-01-19
|
* py: Add full traceback to exception printing.Damien George2014-01-19
|
* py: Add module/function/class name to exceptions.Damien George2014-01-19
| | | | | | | Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
* py: Temporary fix for bug where not enough VM state is allocated.Damien George2014-01-19
|
* Tiny optimisation in objlist.c; a new test for inheritance.Damien George2014-01-19
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-01-18
|\
| * Add objarray.h .Paul Sokolovsky2014-01-19
| |
* | py: Fix VM/runtime unpack sequence bug, Issue #193.Damien George2014-01-18
|/
* Merge pull request #192 from pfalcon/arraysDamien George2014-01-18
|\ | | | | Add skeleton implementation of array.array and bytearray.
| * Add skeleton implementation of array.array and bytearray.Paul Sokolovsky2014-01-18
| | | | | | | | | | So far, only storage, initialization, repr() and buffer protocol is implemented - alredy suitable for passing binary data around.
* | Add source file name and line number to error messages.Damien George2014-01-18
| | | | | | | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* | Improve method lookup in mp_obj_class_lookup.Damien George2014-01-18
|/ | | | Now searches both locals_dict and methods. Partly addresses Issue #145.
* Implement framework for class-defined built-in operators.Damien George2014-01-18
| | | | | Now working for class-defined methods: __getitem__, __setitem__, __add__, __sub__. Easy to add others.
* Merge pull request #191 from pfalcon/store-itemDamien George2014-01-18
|\ | | | | Add store_item() virtual method to type to implement container[index] = val
| * Add store_item() virtual method to type to implement container[index] = val.Paul Sokolovsky2014-01-18
| |
* | Merge branch 'master' of github.com:dpgeorge/micropythonDamien George2014-01-18
|\ \
| * | int: Add value accessors: mp_obj_int_get() & mp_obj_int_get_checked().Paul Sokolovsky2014-01-18
| |/ | | | | | | | | | | mp_obj_int_get() can be used when just full resolution of C machine_int_t is required (returns truncated value of long int). mp_obj_int_get_checked() will throw exception if Python int value not representable in machine_int_t.
| * Add OverflowError and use it for small int overflow instead of assert.Paul Sokolovsky2014-01-18
| |
* | 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.
* Implement LOAD_CONST_INT (by dispatching to int object implementation).Paul Sokolovsky2014-01-17
|
* Add long int implementation using C long long type, enable for unix port.Paul Sokolovsky2014-01-17
|
* Add empty (false) value testing for strings, tuples, lists, dicts.Paul Sokolovsky2014-01-16
|
* Add empty "micropython" module to allow more seamless CPython portability.Paul Sokolovsky2014-01-16
| | | | | | | Implicit "micropython" module contains (at least) codegeneration decorators. Make it explicit, so an app could have "import micropython". On MicroPython, that will be no-op. On CPython, that will give a chance to have a module with placeholder decorators.
* Make file.read() and file.read(-1) call out to file.readall().Paul Sokolovsky2014-01-16
| | | | Per Python3 io module semantics.
* Do not assume that vstr buf is the same after it was extended.Paul Sokolovsky2014-01-16
|
* str.format: Don't assume that '}' immediately follows '{', skip insides.Paul Sokolovsky2014-01-16
| | | | | That at least makes stuff like "{:x}".format(1) to produce not completely broken output.
* Add errno=0 before call.Damien George2014-01-15
|
* stm: Fix print methods with new kind argument.Damien George2014-01-15
|
* Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2intDamien George2014-01-15
|\ | | | | | | | | | | | | Conflicts: py/objint.c unix-cpy/Makefile unix/Makefile
| * add more tests and remove debug codexyb2014-01-15
| |