aboutsummaryrefslogtreecommitdiff
path: root/py/objlist.c
AgeCommit message (Collapse)Author
2014-02-15Implement proper exception type hierarchy.Damien George
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.
2014-02-15Change mp_obj_type_t.name from const char * to qstr.Damien George
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.
2014-02-12Remove mp_obj_new_exception_msg_1_arg and _2_arg.Damien George
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.Paul Sokolovsky
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().
2014-02-10Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-02-10Factor out mp_seq_count_obj() and implement tuple.count().Paul Sokolovsky
2014-02-10Factor out mp_seq_index_obj() function to implement .index() on sequences.Paul Sokolovsky
2014-02-08Implement tuple addition.Paul Sokolovsky
2014-02-08Refactor list comparison code to mp_seq_cmp_objs().Paul Sokolovsky
2014-02-08py: Add some qstrs to the global table.Damien George
2014-02-04mp_obj_new_list(n, items): Copy items only if not-NULL.Paul Sokolovsky
Similar to mp_obj_new_tuple().
2014-02-02Fix assert() usage.Paul Sokolovsky
2014-02-02Implement slicing for lists.Paul Sokolovsky
2014-02-01py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
2014-01-30Implement __bool__ and __len__ via unary_op virtual method for all types.Paul Sokolovsky
__bool__() and __len__() are just the same as __neg__() or __invert__(), and require efficient dispatching implementation (not requiring search/lookup). type->unary_op() is just the right choice for this short of adding standalone virtual method(s) to already big mp_obj_type_t structure.
2014-01-27Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-01-27py: Add unary op not for NoneType, bool, tuple, list, dict; fix for int.Damien George
2014-01-27list.pop(): Don't allow ->alloc drop to zero, which causes unexpected behavior.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-21sequence.c: Start to refactor sequence operations for reuse among types.Paul Sokolovsky
2014-01-19Change int to uint for n_args in function with variable arguments.Damien George
2014-01-19Tiny optimisation in objlist.c; a new test for inheritance.Damien George
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-14Tidy up.Damien George
2014-01-13Made sorted() raise an exception instead of aborting when given no ↵John R. Lenton
arguments; moved around some things in objfun.c as a consequence
2014-01-13sortedJohn R. Lenton
2014-01-12list: Implement comparison operators.Paul Sokolovsky
2014-01-12list: Add extend() methods and += operator.Paul Sokolovsky
2014-01-11unified the bopsJohn R. Lenton
2014-01-11list: Implement list multiplication.Paul Sokolovsky
2014-01-08py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.Damien George
2014-01-07py: Small big fix to type declarations.Damien George
2014-01-07A bit of stylistic cleanup (chose the wrong side during conflict resolution).John R. Lenton
2014-01-07Merge remote-tracking branch 'upstream/master' into listsort. Lots of ↵John R. Lenton
conflict fun. Conflicts: py/obj.h py/objbool.c py/objboundmeth.c py/objcell.c py/objclass.c py/objclosure.c py/objcomplex.c py/objdict.c py/objexcept.c py/objfun.c py/objgenerator.c py/objinstance.c py/objmodule.c py/objrange.c py/objset.c py/objslice.c
2014-01-07This implements a better (more python-conformant) list.sort.John R. Lenton
It's not really about that, though; it's about me figuring out a sane way forward for keyword-argument functions (and function metadata). But it's useful as is, and shouldn't break any existing code, so here you have it; I'm going to park it in my mind for a bit while sorting out the rest of the dict branch.
2014-01-07Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George
ian-v-cplusplus Conflicts: py/objcomplex.c
2014-01-06Make list and str method tables statician-v
2014-01-06Revert MP_BOOL, etc. and use <stdbool.h> insteadian-v
2014-01-06Co-exist with C++ (issue #85)ian-v
2014-01-06Merge remote-tracking branch 'upstream/master' into list_reverseJohn R. Lenton
2014-01-05Merge branch 'list_remove' of git://github.com/chipaca/micropython into ↵Damien George
chipaca-list_remove
2014-01-05Merge pull request #92 from chipaca/list_insertDamien George
List insert. Fixes issue #61.
2014-01-05Merge pull request #91 from chipaca/list_indexDamien George
Fix off-by-one in non-default values of index's 2nd and 3rd arguments.
2014-01-05Merge remote-tracking branch 'upstream/master' into list_reverseJohn R. Lenton
2014-01-05Merge remote-tracking branch 'upstream/master' into list_removeJohn R. Lenton
2014-01-05Merge remote-tracking branch 'upstream/master' into list_insertJohn R. Lenton
2014-01-05Fix off-by-one in non-default values of index's 2nd and 3rd arguments.John R. Lenton
2014-01-05Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky