- 21 Sep, 2016 1 commit
-
-
Damien George authored
One can instead lookup __name__ in the modules dict to get the value.
-
- 12 Aug, 2016 1 commit
-
-
Paul Sokolovsky authored
Checks for number of args removes where guaranteed by function descriptor, self checking is replaced with mp_check_self(). In few cases, exception is raised instead of assert.
-
- 13 Apr, 2016 1 commit
-
- 12 Apr, 2016 1 commit
-
-
Paul Sokolovsky authored
-
- 14 Mar, 2016 1 commit
-
-
Damien George authored
Passing an mp_uint_t to a %d printf format is incorrect for builds where mp_uint_t is larger than word size (eg a nanboxing build). This patch adds some simple casting to int in these cases.
-
- 11 Jan, 2016 2 commits
-
-
Damien George authored
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
-
Damien George authored
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
-
- 04 Jan, 2016 1 commit
-
-
Damien George authored
-
- 03 Jan, 2016 2 commits
-
-
Dave Hylands authored
-
Damien George authored
-
- 18 Dec, 2015 1 commit
-
-
Damien George authored
MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler, which is useful when only loading of pre-compiled bytecode is supported. It is enabled by default. MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin functions. By default they are only included if MICROPY_ENABLE_COMPILER is enabled. Disabling both options saves about 40k of code size on 32-bit x86.
-
- 07 Dec, 2015 2 commits
- 29 Nov, 2015 2 commits
-
-
Damien George authored
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
-
Damien George authored
-
- 23 Nov, 2015 1 commit
-
-
Damien George authored
Fixes issue #1623.
-
- 20 Oct, 2015 1 commit
-
-
Damien George authored
-
- 17 Oct, 2015 1 commit
-
-
Damien George authored
Only available when MICROPY_CAN_OVERRIDE_BUILTINS is enabled.
-
- 11 Oct, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 30 Aug, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 19 Aug, 2015 1 commit
-
-
Paul Sokolovsky authored
Saves 320 bytes on x86.
-
- 19 Jul, 2015 1 commit
-
-
Sebastian Plamauer authored
-
- 13 Jun, 2015 1 commit
-
-
Damien George authored
-
- 05 Jun, 2015 1 commit
-
-
Damien George authored
-
- 12 May, 2015 1 commit
-
-
Damien George authored
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as the operator argument. Hashing for int, str and bytes still go via fast-path in mp_unary_op since they are the most common objects which need to be hashed. This lead to quite a bit of code cleanup, and should be more efficient if anything. It saves 176 bytes code space on Thumb2, and 360 bytes on x86. The only loss is that the error message "unhashable type" is now the more generic "unsupported type for __hash__".
-
- 05 May, 2015 1 commit
-
-
Paul Sokolovsky authored
Having NotImplemented as MP_OBJ_SENTINEL turned out to be problematic (it needs to be checked for in a lot of places, otherwise it'll crash as would pass MP_OBJ_IS_OBJ()), so made a proper singleton value like Ellipsis, both of them sharing the same type.
-
- 04 May, 2015 1 commit
-
-
Paul Sokolovsky authored
From https://docs.python.org/3/library/constants.html#NotImplemented : "Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for the same purpose. Its truth value is true." Some people however appear to abuse it to mean "no value" when None is a legitimate value (don't do that).
-
- 20 Apr, 2015 1 commit
-
-
Damien George authored
This fixes a long standing problem that viper code generation gave terrible error messages, and actually no errors on pyboard where assertions are disabled. Now all compile-time errors are raised as proper Python exceptions, and are of type ViperTypeError. Addresses issue #940.
-
- 19 Apr, 2015 1 commit
-
-
Damien George authored
Addresses issue #1188.
-
- 16 Apr, 2015 3 commits
-
-
Damien George authored
-
Damien George authored
So now all printing should go via either mp_plat_print or mp_sys_stdout_print.
-
Damien George authored
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.
-
- 09 Apr, 2015 1 commit
-
-
stijn authored
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
-
- 06 Apr, 2015 2 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
- 30 Mar, 2015 1 commit
-
-
Paul Sokolovsky authored
Per https://docs.python.org/3/library/functions.html#round, 2-args format guaranteedly returns float.
-
- 19 Mar, 2015 1 commit
-
-
Damien George authored
-
- 14 Mar, 2015 1 commit
-
-
Damien George authored
-
- 02 Mar, 2015 1 commit
-
-
Damien George authored
-
- 23 Feb, 2015 1 commit
-
-
Paul Sokolovsky authored
Still too shy to implement UnicodeEncodeError which was really needed for micropython-lib case.
-