summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-01-23py: Implement bool unary op; tidy up unary op dispatch.Damien George
2014-01-23py: Simpler implementation of mp_obj_callable.Damien George
2014-01-23mp_obj_is_callable(): Only object types can be callable.Paul Sokolovsky
Fixes segfault on callable("string").
2014-01-23Implement simplest case of str.startswith().Paul Sokolovsky
2014-01-23py: Use C99 way of variable macro arguments.Damien George
Addresses Issue #207.
2014-01-23py: Change macro var args in parser to be C99 compliant.Damien George
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-22Fix 1 warning and 1 bug.Damien George
2014-01-22Implement octal and hex escapes in strings.Paul Sokolovsky
2014-01-22file.readline(): Use mp_obj_str_get_data() and fix off-by-one error on EOF.Paul Sokolovsky
2014-01-22Second stage of qstr revamp: uPy str object can be qstr or not.Damien George
2014-01-22py: Remove implicit conversion of float to int in mp_obj_get_int().Damien George
Addresses Issue #199.
2014-01-21Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-01-21py: Implement break and continue byte codes, and add tests.Damien George
Also fixes a bug in the for-in-range optimiser. I hope to remove break and continue byte codes in the future and just use jump (if possible).
2014-01-21Fix malformed generated file when using python 2.7Dave Hylands
2014-01-21array: Implement iterator.Paul Sokolovsky
2014-01-21Add len() support for arrays.Paul Sokolovsky
2014-01-21Merge branch 'master' of github.com:micropython/micropythonDamien George
Conflicts: py/objstr.c py/py.mk py/stream.c unix/main.c unix/socket.c
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-21Implement str.split(None).Paul Sokolovsky
Note that splitting by explicit string is not implemented so far.
2014-01-21str: Implement proper string (instead of byte string) indexing.Paul Sokolovsky
Also, support negative indexes.
2014-01-21Implement string multiplication.Paul Sokolovsky
2014-01-21sequence.c: Start to refactor sequence operations for reuse among types.Paul Sokolovsky
2014-01-20objstr: More support for MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20mp_obj_get_type_str(): Handle MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20Add dummy bytes() constructor.Paul Sokolovsky
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).
2014-01-20stream_read(): Shrink memory block to actual read size.Paul Sokolovsky
2014-01-20stream: Add generic unbuffered iternext method.Paul Sokolovsky
Uses stream_unbuffered_readline underline.
2014-01-20mp_identity(): Add generic identity function.Paul Sokolovsky
Useful as getiter method for objects which are their own iterators, etc.
2014-01-20mp_obj_get_qstr(): Handle MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20py: Put micropython module init code in builtinmp.c.Damien George
2014-01-20Expose memory stats functions via "micropython" module.Paul Sokolovsky
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.
2014-01-20Don't implicitly import "sys" module.Paul Sokolovsky
2014-01-20Pre-create sys module.Paul Sokolovsky
2014-01-20Properly print MP_OBJ_QSTR objects.Paul Sokolovsky
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-19Change int to uint for n_args in function with variable arguments.Damien George
2014-01-19py: Add full traceback to exception printing.Damien George
2014-01-19py: Add module/function/class name to exceptions.Damien George
Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
2014-01-19py: Temporary fix for bug where not enough VM state is allocated.Damien George
2014-01-19Tiny optimisation in objlist.c; a new test for inheritance.Damien George
2014-01-18Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-01-18py: Fix VM/runtime unpack sequence bug, Issue #193.Damien George
2014-01-19Add objarray.h .Paul Sokolovsky
2014-01-18Merge pull request #192 from pfalcon/arraysDamien George
Add skeleton implementation of array.array and bytearray.
2014-01-18Add source file name and line number to error messages.Damien George
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
2014-01-18Improve method lookup in mp_obj_class_lookup.Damien George
Now searches both locals_dict and methods. Partly addresses Issue #145.
2014-01-18Add skeleton implementation of array.array and bytearray.Paul Sokolovsky
So far, only storage, initialization, repr() and buffer protocol is implemented - alredy suitable for passing binary data around.
2014-01-18Implement framework for class-defined built-in operators.Damien George
Now working for class-defined methods: __getitem__, __setitem__, __add__, __sub__. Easy to add others.
2014-01-18Merge pull request #191 from pfalcon/store-itemDamien George
Add store_item() virtual method to type to implement container[index] = val