circuitpython/ports
Nicko van Someren 4c93955b7b py/objslice: Add support for indices() method on slice objects.
Instances of the slice class are passed to __getitem__() on objects when
the user indexes them with a slice.  In practice the majority of the time
(other than passing it on untouched) is to work out what the slice means in
the context of an array dimension of a particular length.  Since Python 2.3
there has been a method on the slice class, indices(), that takes a
dimension length and returns the real start, stop and step, accounting for
missing or negative values in the slice spec.  This commit implements such
a indices() method on the slice class.

It is configurable at compile-time via MICROPY_PY_BUILTINS_SLICE_INDICES,
disabled by default, enabled on unix, stm32 and esp32 ports.

This commit also adds new tests for slice indices and for slicing unicode
strings.
2019-12-28 23:55:15 +11:00
..
bare-arm ports: Allow overriding CROSS_COMPILE in a custom makefile. 2019-12-27 23:53:16 +11:00
cc3200 extmod/vfs: Rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx. 2019-10-29 14:17:29 +11:00
esp32 py/objslice: Add support for indices() method on slice objects. 2019-12-28 23:55:15 +11:00
esp8266 ports: Allow overriding CROSS_COMPILE in a custom makefile. 2019-12-27 23:53:16 +11:00
javascript py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
minimal ports: Allow overriding CROSS_COMPILE in a custom makefile. 2019-12-27 23:53:16 +11:00
nrf nrf/examples: Fix typo in mountsd.py, wireing -> wiring. 2019-12-28 12:07:30 +11:00
pic16bit ports: Allow overriding CROSS_COMPILE in a custom makefile. 2019-12-27 23:53:16 +11:00
powerpc ports: Allow overriding CROSS_COMPILE in a custom makefile. 2019-12-27 23:53:16 +11:00
qemu-arm qemu-arm/Makefile: Allow overriding CROSS_COMPILE from another makefile. 2019-12-19 17:59:32 +11:00
samd ports: Add new make target "submodules" which inits required modules. 2019-10-15 17:14:41 +11:00
stm32 py/objslice: Add support for indices() method on slice objects. 2019-12-28 23:55:15 +11:00
teensy lib/utils/pyexec: Introduce MICROPY_REPL_INFO, wrap debug prints in it. 2019-12-28 00:05:39 +11:00
unix py/objslice: Add support for indices() method on slice objects. 2019-12-28 23:55:15 +11:00
windows unix,windows: Enable module weak links. 2019-10-22 16:23:43 +11:00
zephyr zephyr/main: Use mp_stack API instead of local pointer for stack top. 2019-10-29 23:05:07 +11:00