stijn
6b636738b2
py: Fix segfault in namedtuple when name is a non-interned string
- 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
10 years ago
Damien George
ff8dd3f486
py, unix: Allow to compile with -Wunused-parameter.
See issue #699 .
10 years ago
Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022 .
10 years ago
Damien George
84e0cf0d21
py: Change namedtuple error messages to reduce code size.
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.
10 years ago
Damien George
7f23384d49
py: Make terse_arg_mismatch a global function and use it elsewhere.
Reduces code size when MICROPY_ERROR_REPORTING_TERSE is selected.
10 years ago
Paul Sokolovsky
276159e5dd
objnamedtuple: Make sure to initialize type structure completely.
10 years ago
stijn
021dc44009
py: Allow keyword arguments for namedtuple
10 years ago
stijn
12340147b0
py: Use sequence of strings for named tuple initialization
- remove single string initialization style
- take list of strings instead
- store list in the type for fast lookup
10 years ago
Damien George
969a6b37bf
py: Make functions static where appropriate.
10 years ago
Damien George
42f3de924b
py: Convert [u]int to mp_[u]int_t where appropriate.
Addressing issue #50 .
10 years ago
Damien George
ecc88e949c
Change some parts of the core API to use mp_uint_t instead of uint/int.
Addressing issue #50 , still some way to go yet.
10 years ago
Damien George
ee3fd46f13
Rename configuration variables controling Python features.
Now of the form MICROPY_PY_*. See issue #35 .
11 years ago
Paul Sokolovsky
da9f0924ef
py, unix: Add copyright for modules I worked closely on.
11 years ago
Damien George
2323ef9182
py: Rename globally-accessible tuple functions, prefix with mp_obj_.
Likely there are other functions that should be renamed, but this is a
start.
11 years ago
Paul Sokolovsky
7067d69bcc
objnamedtuple: Support iteration.
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
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/.
11 years ago
Paul Sokolovsky
f54bcbf099
py, unix: Make "mpconfig.h" be first included, as other headers depend on it.
Specifically, nlr.h does.
11 years ago
Damien George
107c9fb235
py: Make collections module configurable, enabled by default.
11 years ago
Damien George
729f7b42d6
py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
mp_obj_t->subscr now does load/store/delete.
11 years ago
Damien George
ea13f407a3
py: Change nlr_jump to nlr_raise, to aid in debugging.
This does not affect code size or performance when debugging turned off.
To address issue #420 .
11 years ago
Damien George
07ddab529c
py: Change mp_const_* objects to macros.
Addresses issue #388 .
11 years ago
Paul Sokolovsky
e74f52b76c
namedtuple: Inherit unary/binary ops from tuple base class.
11 years ago
Paul Sokolovsky
d08fd68664
Add basic collections.namedtuple implementation.
11 years ago