- Oct 04, 2017
-
-
Damien George authored
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
-
- Sep 19, 2017
-
-
Paul Sokolovsky authored
An issue was due to incorrectly taking size of default strip characters set.
-
- Sep 06, 2017
-
-
tll authored
This patch adds a function utf8_check() to check for a valid UTF-8 encoded string, and calls it when constructing a str from raw bytes. The feature is selectable at compile time via MICROPY_PY_BUILTINS_STR_UNICODE_CHECK and is enabled if unicode is enabled. It costs about 110 bytes on Thumb-2, 150 bytes on Xtensa and 170 bytes on x86-64.
-
- Aug 29, 2017
-
-
Damien George authored
The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
-
- Aug 28, 2017
-
-
Paul Sokolovsky authored
Otherwise, it will silently get incorrect result on other values types, including CPython tuple form like "foo.png".endswith(("png", "jpg")) (which MicroPython doesn't support for unbloatedness).
-
- Aug 13, 2017
-
-
Javier Candeira authored
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
-
- Aug 09, 2017
-
-
Damien George authored
The main case to catch is invalid types for the containment operator, of the form str.__contains__(non-str).
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 03, 2017
-
-
Damien George authored
-
- Jul 02, 2017
-
-
Damien George authored
This matches the coding/layout style of all the other objects.
-
- Jun 07, 2017
-
-
Damien George authored
-
- Jun 02, 2017
-
-
Damien George authored
Negative values mean no limit on the number of splits so should delegate to the .split() method.
-
- May 29, 2017
-
-
Ville Skyttä authored
-
- Apr 02, 2017
-
-
Paul Sokolovsky authored
Split this setting from MICROPY_CPYTHON_COMPAT. The idea is to be able to keep MICROPY_CPYTHON_COMPAT disabled, but still pass more of regression testsuite. In particular, this fixes last failing test in basics/ for Zephyr port.
-
- Mar 29, 2017
-
-
Damien George authored
-
Damien George authored
This patch changes mp_uint_t to size_t for the len argument of the following public facing C functions: mp_obj_tuple_get mp_obj_list_get mp_obj_get_array These functions take a pointer to the len argument (to be filled in by the function) and callers of these functions should update their code so the type of len is changed to size_t. For ports that don't use nan-boxing there should be no change in generate code because the size of the type remains the same (word sized), and in a lot of cases there won't even be a compiler warning if the type remains as mp_uint_t. The reason for this change is to standardise on the use of size_t for variables that count memory (or memory related) sizes/lengths. It helps builds that use nan-boxing.
-
- Mar 23, 2017
-
-
Damien George authored
These values are used to compute memory addresses and so size_t is the more appropriate type to use.
-
- Mar 20, 2017
-
-
stijn authored
Instead of always reporting some object cannot be implicitly be converted to a 'str', even when it is a 'bytes' object, adjust the logic so that when trying to convert str to bytes it is shown like that. This will still report bad implicit conversion from e.g. 'int to bytes' as 'int to str' but it will not result in the confusing 'can't convert 'str' object to str implicitly' anymore for calls like b'somestring'.count('a').
-
- Mar 16, 2017
-
-
Damien George authored
The RHS can only be returned if it is the same type as the LHS.
-
- Mar 07, 2017
-
-
Krzysztof Blazewicz authored
-
- Feb 16, 2017
-
-
Damien George authored
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
-
Damien George authored
-
- Feb 03, 2017
-
-
Damien George authored
-
Damien George authored
This patch fixes two main things: - dicts can be printed directly using '%s' % dict - %-formatting should not crash when passed a non-dict to, eg, '%(foo)s'
-
- Jan 26, 2017
-
-
Paul Sokolovsky authored
In this, don't allocate copy, just return non-empty string. This helps with a standard pattern of buffering data in case of short reads: buf = b"" while ...: s = f.read(...) buf += s ... For a typical case when single read returns all data needed, there won't be extra allocation. This optimization helps uasyncio.
-
- Sep 27, 2016
-
-
Damien George authored
-
- Sep 02, 2016
-
-
Damien George authored
-
- Aug 14, 2016
-
-
Damien George authored
This patch does further refactoring using the new mp_raise_TypeError and mp_raise_ValueError functions.
-
- Aug 12, 2016
-
-
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.
-
Paul Sokolovsky authored
Introduce mp_raise_msg(), mp_raise_ValueError(), mp_raise_TypeError() instead of previous pattern nlr_raise(mp_obj_new_exception_msg(...)). Save few bytes on each call, which are many.
-
- Aug 07, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Default is disabled, enabled for unix port. Saves 600 bytes on x86.
-
- May 21, 2016
-
-
Paul Sokolovsky authored
-
Dave Hylands authored
-
Paul Sokolovsky authored
Disabled by default, enabled in unix port. Need for this method easily pops up when working with text UI/reporting, and coding workalike manually again and again counter-productive.
-
- May 13, 2016
-
-
Damien George authored
It now supports \n, \r and \r\n as newline separators. Adds 56 bytes to stmhal and 80 bytes to unix x86-64. Fixes issue #1689.
-
- May 09, 2016
-
-
Paul Sokolovsky authored
This reverts commit 6de8dbb4. The change was incorrect (correct change would require comparing with end pointer in each if statement in the block).
-
Paul Sokolovsky authored
By comparing with string end pointer instead of checking for NUL byte. Should alleviate reallocations and fragmentation a tiny bit.
-
- May 07, 2016
-
-
Damien George authored
The type is an unsigned 8-bit value, since bytes objects are exactly that. And it's also sensible for unicode strings to return unsigned values when accessed in a byte-wise manner (CPython does not allow this).
-
- Apr 14, 2016
-
-
Damien George authored
-