| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
Most of printing infrastructure now uses streams, but mp_obj_print() used
libc's printf(), which led to weird buffering issues in output. So, switch
mp_obj_print() to streams too, even though it may make sense to move it to
a separate file, as it is purely a debugging function now.
|
|
|
|
|
| |
Defining NDEBUG (to any value, even 0) disables debugging. Otherwise,
if it's not defined, debugging is enabled.
|
|
|
|
| |
See issue #699.
|
| |
|
|
|
|
|
| |
Return "not equal" for objects that don't implement equality check.
This is as per Python specs.
|
|
|
|
| |
Addresses issue #1022.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function is modeled after traceback.print_exception(), but unbloated,
and put into existing module to save overhead on adding another module.
Compliant traceback.print_exception() is intended to be implemented in
micropython-lib in terms of sys.print_exception().
This change required refactoring mp_obj_print_exception() to take pfenv_t
interface arguments.
Addresses #751.
|
|
|
|
|
|
|
|
|
|
|
| |
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.
Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.
Addresses issues #779 and #998.
|
| |
|
|
|
|
|
|
|
|
| |
Going from MICROPY_ERROR_REPORTING_NORMAL to
MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2,
and 2200 bytes ROM for 32-bit x86.
This is about a 2.5% code size reduction for bare-arm.
|
|
|
|
| |
Addresses issue #953.
|
| |
|
| |
|
|
|
|
| |
Part of code cleanup, working towards resolving issue #50.
|
|
|
|
| |
Part of code cleanup, to resolve issue #50.
|
|
|
|
|
|
|
|
| |
Because (for Thumb) a function pointer has the LSB set, pointers to
dynamic functions in RAM (eg native, viper or asm functions) were not
being traced by the GC. This patch is a comprehensive fix for this.
Addresses issue #820.
|
|
|
|
|
|
|
|
| |
reversed function now implemented, and works for tuple, list, str, bytes
and user objects with __len__ and __getitem__.
Renamed mp_builtin_len to mp_obj_len to make it publically available (eg
for reversed).
|
|
|
|
|
|
| |
This happens for example for zero-size arrays. As .get_buffer() method now
has explicit return value, it's enough to distinguish success vs failure
of getting buffer.
|
|
|
|
| |
Addresses issue #724.
|
|
|
|
| |
Addresses issue #765.
|
|
|
|
| |
See discussion in issue #50.
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
py/mpconfig.h
|
| |
| |
| |
| | |
With a test which cannot be automatically validated so far.
|
|/ |
|
|
|
|
|
| |
One thing is wanting to do 1 / 2 and get something else but 0, and quite
another - doing rocket science ;-).
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
See issue #608 for justification.
|
| |
|
|
|
|
| |
Having both MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL is arguably confusing.
|
| |
|
|
|
|
| |
Happens regularly when used for debugging.
|
|
|
|
|
|
|
| |
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/.
|
|
|
|
| |
Specifically, nlr.h does.
|
| |
|
|
|
|
|
|
|
| |
When querying an object that supports the buffer protocol, that object
must now return a typecode (as per binary.[ch]). This does not have to
be honoured by the caller, but can be useful for determining element
size.
|
|
|
|
|
| |
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL.
This helps a lot in debugging and understanding of function API.
|
|
|
|
| |
mp_obj_t->subscr now does load/store/delete.
|
| |
|
| |
|
|
|
|
|
| |
Must use mp_obj_get_type to get the type of an object. Can't assume
mp_obj_t is castable to mp_obj_base_t.
|
| |
|
|
|
|
|
|
| |
Also convert mp_obj_is_integer to an inline function.
Overall this decreased code size (at least on 32-bit x86 machine).
|
|
|
|
|
| |
It regressed a bit after implementing float/complex equality. Now it
should be improved, and support more equality tests.
|
|
|
|
|
|
|
| |
It has (again) a fast path for ints, and a simplified "slow" path for
everything else.
Also simplify the way str indexing is done (now matches tuple and list).
|
|
|
|
| |
Addresses issue #462.
|
| |
|
|
|
|
|
| |
mp_obj_is_integer should be used to check if an object is of integral
type. It returns true for bool, small int and long int.
|
| |
|