aboutsummaryrefslogtreecommitdiff
path: root/py/obj.c
AgeCommit message (Collapse)Author
2015-04-09py: Use a dummy type for referring to extern structsstijn
Fixes msvc linker warnings about mismatching sizes between the mp_obj_fdfile_t struct defined in file.c and the mp_uint_t declarations found in modsys.c and modbuiltins.c
2015-02-17py: Fix mp_obj_print() to work when Python streams are not used.Paul Sokolovsky
2015-02-17py: Revamp mp_obj_print() to use Python streams.Paul Sokolovsky
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.
2015-01-25py: Check for NDEBUG using #ifdef rather than #if.Damien George
Defining NDEBUG (to any value, even 0) disables debugging. Otherwise, if it's not defined, debugging is enabled.
2015-01-16py, unix: Allow to compile with -Wsign-compare.Damien George
See issue #699.
2015-01-12py: Can compile with -Wmissing-declarations and -Wmissing-prototypes.Damien George
2015-01-11py: Implement fallback for equality check for all types.Damien George
Return "not equal" for objects that don't implement equality check. This is as per Python specs.
2015-01-01py: Move to guarded includes, everywhere in py/ core.Damien George
Addresses issue #1022.
2014-12-08modsys: Add sys.print_exception(exc, file=sys.stdout) function.Paul Sokolovsky
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.
2014-12-05py: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.Damien George
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.
2014-11-15py: Use __hash__ method if a type defines itstijn
2014-11-06py: Use shorter, static error msgs when ERROR_REPORTING_TERSE enabled.Damien George
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.
2014-11-03py: Fix builtin callable so it checks user-defined instances correctly.Damien George
Addresses issue #953.
2014-09-07py: Rename mp_builtin_id to mp_obj_id and make it public.Damien George
2014-08-30py: Small simplifications in tuple and list accessors.Damien George
2014-08-30py: Remove use of int type in obj.h.Damien George
Part of code cleanup, working towards resolving issue #50.
2014-08-30py: Make tuple and list use mp_int_t/mp_uint_t.Damien George
Part of code cleanup, to resolve issue #50.
2014-08-24py: Fix bug where GC collected native/viper/asm function data.Damien George
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.
2014-08-12py: Implement builtin reversed() function.Damien George
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).
2014-08-10py: mp_buffer_info_t::buf may be valid, but NULL for empty objects.Paul Sokolovsky
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.
2014-07-31py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George
Addresses issue #724.
2014-07-24py: Make long ints hashable.Damien George
Addresses issue #765.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-07-01stackctrl: Add "mp_" prefix.Paul Sokolovsky
2014-06-28Merge branch 'master' into unicodeDamien George
Conflicts: py/mpconfig.h
2014-06-28py: Add protection against printing too nested or recursive data structures.Paul Sokolovsky
With a test which cannot be automatically validated so far.
2014-06-27objstrunicode: Revamp len() handling for unicode, and optimize bool().Paul Sokolovsky
2014-06-20py: Separate MICROPY_PY_BUILTINS_COMPLEX from MICROPY_PY_BUILTINS_FLOAT.Paul Sokolovsky
One thing is wanting to do 1 / 2 and get something else but 0, and quite another - doing rocket science ;-).
2014-06-01Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George
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.
2014-05-21py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.Damien George
See issue #608 for justification.
2014-05-17py: More const usage.Paul Sokolovsky
2014-05-11py: Fix __len__ special method result handling.Paul Sokolovsky
Having both MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL is arguably confusing.
2014-05-11py: Start making good use of mp_const_obj_t.Paul Sokolovsky
2014-05-10py: Make mp_obj_print() handle null object w/o segfault if debug build.Paul Sokolovsky
Happens regularly when used for debugging.
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-05-02py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky
Specifically, nlr.h does.
2014-04-18py: Allow to pass buffer protocol flags to get_buffer helper funcs.Damien George
2014-04-18py: Add typecode to buffer protocol.Damien George
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.
2014-04-17py: Add MP_OBJ_STOP_ITERATION and make good use of it.Damien George
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
2014-04-17py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.Damien George
mp_obj_t->subscr now does load/store/delete.
2014-04-15py: Add len(bytes).Damien George
2014-04-13py: Fix SyntaxError exception: don't have a block name, so pass NULL.Damien George
2014-04-13py: Fix mp_get_buffer, and use it in more places.Damien George
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.
2014-04-13py: Make bytes type hashable.Paul Sokolovsky
2014-04-11py: Convert some macros to inline functions (in obj.h).Damien George
Also convert mp_obj_is_integer to an inline function. Overall this decreased code size (at least on 32-bit x86 machine).
2014-04-11py: Fix up object equality test.Damien George
It regressed a bit after implementing float/complex equality. Now it should be improved, and support more equality tests.
2014-04-11py: Simplify and improve mp_get_index.Damien George
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).
2014-04-11py: Implement float and complex == and !=.Damien George
Addresses issue #462.
2014-04-11py: Check that sequence has 2 elements for dict iterable constructor.Damien George
2014-04-09py: Add mp_obj_is_integer; make mp_get_index check for long int.Damien George
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.