summaryrefslogtreecommitdiffstatshomepage
path: root/py/objset.c
Commit message (Collapse)AuthorAge
* py: Make map, dict, set use mp_int_t/mp_uint_t exclusively.Damien George2014-08-30
| | | | Part of code cleanup, towards resolving issue #50.
* Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George2014-08-30
| | | | Addressing issue #50, still some way to go yet.
* py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George2014-07-31
| | | | Addresses issue #724.
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* py: Add option to disable set() object (enabled by default).Damien George2014-06-01
|
* Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George2014-06-01
| | | | | | | | | | This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
* Rename configuration variables controling Python features.Damien George2014-05-24
| | | | Now of the form MICROPY_PY_*. See issue #35.
* py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.Damien George2014-05-21
| | | | See issue #608 for justification.
* py: frozenset() creates an empty frozenset.Damien George2014-05-11
|
* py: Disable frozenset by default, enable on unix.Paul Sokolovsky2014-05-10
| | | | Takes 416 text bytes on x86.
* objset: Give up and implement frozenset.Paul Sokolovsky2014-05-10
| | | | Tired of patching CPython stdlib for it.
* py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.Damien George2014-05-10
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky2014-05-02
| | | | Specifically, nlr.h does.
* py: Add MP_OBJ_STOP_ITERATION and make good use of it.Damien George2014-04-17
| | | | | Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
* py: Factor out impl of special methods for builtin types into opmethods.cPaul Sokolovsky2014-04-13
|
* objset: Implement __contains__() op-method.Paul Sokolovsky2014-04-13
|
* py: Remove useless implementations of NOT_EQUAL in binary_op's.Damien George2014-04-12
| | | | | | | I'm pretty sure these are never reached, since NOT_EQUAL is always converted into EQUAL in mp_binary_op. No one should call type.binary_op directly, they should always go through mp_binary_op (or mp_obj_is_equal).
* objset: Fix incorrect workaround against mp_set_init() munging alloc size.Paul Sokolovsky2014-04-07
| | | | | No longer needed after recent change which guarantees that mp_set_init() will allocate exact number of slots requested.
* py: Change module globals from mp_map_t* to mp_obj_dict_t*.Damien George2014-04-05
| | | | | | Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
* py: Change nlr_jump to nlr_raise, to aid in debugging.Damien George2014-04-05
| | | | | | This does not affect code size or performance when debugging turned off. To address issue #420.
* py: Fix delete operation on map/dict and set objects.Damien George2014-04-05
| | | | | | Hash table can now be completely full (ie now NULL entry) before a resize is triggered. Use sentinel value to indicate delete entry in the table.
* py: Fix "TypeError: 'iterator' object is not iterable", doh.Paul Sokolovsky2014-03-30
|
* 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.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* py: Rename old const type objects to mp_type_* for consistency.Damien George2014-03-29
|
* Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
| | | | | | | | | | | | | | | | | | | | | | Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
* Change mp_method_t.name from const char * to qstr.Damien George2014-03-26
| | | | Addresses issue #377.
* py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.Damien George2014-03-26
|
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* 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.
* Remove mp_obj_new_exception_msg_1_arg and _2_arg.Damien George2014-02-12
|
* 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().
* py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George2014-02-01
| | | | | IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
* 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
* Change int to uint for n_args in function with variable arguments.Damien George2014-01-19
|
* 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
|
* Fixed the merge so it worked and compiled and stuffJohn R. Lenton2014-01-13
|
* Merge remote-tracking branch 'upstream/master' into containmentJohn R. Lenton2014-01-13
|\
| * oops, nasty off-by-one in set_copyJohn R. Lenton2014-01-12
| |
| * Implemented set binary ops.John R. Lenton2014-01-12
| |
| * Implemented set.updateJohn R. Lenton2014-01-12
| |
| * Implemented set.removeJohn R. Lenton2014-01-12
| |
| * Implemented set.isdisjointJohn R. Lenton2014-01-12
| |
| * Implemented set.intersection and set.intersection_updateJohn R. Lenton2014-01-12
| |
| * Implemented set.difference and set.difference_updateJohn R. Lenton2014-01-12
| |
| * Implemented set.discardJohn R. Lenton2014-01-12
| |
| * Implemented set.copyJohn R. Lenton2014-01-12
| |