summaryrefslogtreecommitdiffstatshomepage
path: root/py/objnamedtuple.c
Commit message (Collapse)AuthorAge
* py: Add attrtuple object, for space-efficient tuples with attr access.Damien George2015-04-21
| | | | | If you need the functionality of a namedtuple but will only make 1 or a few instances, then use an attrtuple instead.
* py: Add %q format support to mp_[v]printf, and use it.Damien George2015-04-16
|
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* py: Combine load_attr and store_attr type methods into one (attr).Damien George2015-04-11
| | | | | | This simplifies the API for objects and reduces code size (by around 400 bytes on Thumb2, and around 2k on x86). Performance impact was measured with Pystone score, but change was barely noticeable.
* objnamedtuple: Accept field list as a string.Paul Sokolovsky2015-03-23
| | | | | This change is required to unbreak some CPython stdlib modules (as included into micropython-lib).
* objnamedtuple: Check that 2nd arg to namedtuple() is a list.Paul Sokolovsky2015-03-22
|
* py: Fix segfault in namedtuple when name is a non-interned stringstijn2015-01-24
| | | | | | | | - namedtuple was wrongly using MP_OBJ_QSTR_VALUE instead of mp_obj_str_get_qstr, so when passed a non-interned string it would segfault; fix this by using mp_obj_str_get_qstr - store the namedtuple field names as qstrs so it is not needed to use mp_obj_str_get_qstr everytime the field name has to be accessed. This also slighty increases performance when fetching attributes
* py, unix: Allow to compile with -Wunused-parameter.Damien George2015-01-20
| | | | See issue #699.
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* py: Change namedtuple error messages to reduce code size.Damien George2015-01-01
| | | | | | We are not word-for-word compatible with CPython exceptions, so we are free to make them short but informative in order to reduce code size. Also, try to make messages the same as existing ones where possible.
* py: Make terse_arg_mismatch a global function and use it elsewhere.Damien George2015-01-01
| | | | Reduces code size when MICROPY_ERROR_REPORTING_TERSE is selected.
* objnamedtuple: Make sure to initialize type structure completely.Paul Sokolovsky2015-01-01
|
* py: Allow keyword arguments for namedtuplestijn2015-01-01
|
* py: Use sequence of strings for named tuple initializationstijn2015-01-01
| | | | | | - remove single string initialization style - take list of strings instead - store list in the type for fast lookup
* py: Make functions static where appropriate.Damien George2014-12-10
|
* py: Convert [u]int to mp_[u]int_t where appropriate.Damien George2014-10-03
| | | | Addressing 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.
* Rename configuration variables controling Python features.Damien George2014-05-24
| | | | Now of the form MICROPY_PY_*. See issue #35.
* py, unix: Add copyright for modules I worked closely on.Paul Sokolovsky2014-05-13
|
* py: Rename globally-accessible tuple functions, prefix with mp_obj_.Damien George2014-05-11
| | | | | Likely there are other functions that should be renamed, but this is a start.
* objnamedtuple: Support iteration.Paul Sokolovsky2014-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: Make collections module configurable, enabled by default.Damien George2014-04-26
|
* py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.Damien George2014-04-17
| | | | mp_obj_t->subscr now does load/store/delete.
* 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: Change mp_const_* objects to macros.Damien George2014-03-29
| | | | Addresses issue #388.
* namedtuple: Inherit unary/binary ops from tuple base class.Paul Sokolovsky2014-03-03
|
* Add basic collections.namedtuple implementation.Paul Sokolovsky2014-03-03