circuitpython/ports/unix
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
..
coverage-frzmpy py: Rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions. 2019-09-26 16:04:56 +10:00
coverage-frzstr ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
.gitignore gitignore: Put build-*/ pattern in top-level gitignore file. 2019-08-16 00:08:08 +10:00
alloc.c ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
coverage.c py/bc: Change mp_code_state_t.exc_sp to exc_sp_idx. 2019-10-01 12:26:22 +10:00
fatfs_port.c ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
fdfile.h ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
file.c py: Introduce MP_ROM_NONE macro for ROM to refer to None object. 2019-12-27 22:51:17 +11:00
gccollect.c unix/gcollect: Make sure stack/regs get captured properly for GC. 2019-05-01 15:06:21 +10:00
input.c ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
input.h ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
main.c py: Integrate sys.settrace feature into the VM and runtime. 2019-08-30 16:44:12 +10:00
Makefile extmod: Consolidate FAT FS config to MICROPY_VFS_FAT across all ports. 2019-11-11 11:37:38 +11:00
manifest_coverage.py unix: Convert to use FROZEN_MANIFEST to specify frozen code. 2019-10-15 21:35:27 +11:00
manifest.py tools/makemanifest.py: Eval relative paths w.r.t. current manifest file. 2019-10-21 23:01:41 +11:00
modffi.c various: Add and update my copyright line based on git history. 2019-05-17 18:04:15 +10:00
modjni.c ports: Convert legacy uppercase macro names to lowercase. 2019-02-12 14:54:51 +11:00
modmachine.c various: Add and update my copyright line based on git history. 2019-05-17 18:04:15 +10:00
modos.c unix/modos: Add uos.rename and uos.rmdir. 2019-12-28 11:54:49 +11:00
modtermios.c unix/modtermios: Fix output speed setter in tcsetattr. 2019-11-21 12:10:32 +11:00
modtime.c unix/modtime: Add utime.mktime function, to complement utime.localtime. 2019-12-28 11:11:54 +11:00
moduos_vfs.c extmod/vfs_lfs: Allow compiling in VfsLfs1 and VfsLfs2 separately. 2019-10-30 12:08:58 +11:00
moduselect.c ports: Convert legacy uppercase macro names to lowercase. 2019-02-12 14:54:51 +11:00
modusocket.c unix/modusocket: Raise ETIMEDOUT when connect or accept has timeout. 2019-05-28 17:22:54 +10:00
mpconfigport_coverage.h extmod: Consolidate FAT FS config to MICROPY_VFS_FAT across all ports. 2019-11-11 11:37:38 +11:00
mpconfigport_fast.h unix: Allow building without a manifest. 2019-10-21 23:21:18 +11:00
mpconfigport_freedos.h ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
mpconfigport_minimal.h py/objstr: Make str.count() method configurable. 2018-10-22 22:49:05 +11:00
mpconfigport_nanbox.h ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
mpconfigport.h py/objslice: Add support for indices() method on slice objects. 2019-12-28 23:55:15 +11:00
mpconfigport.mk unix/mpconfigport.mk: Update comment about TLS implementations. 2019-06-05 15:28:30 +10:00
mphalport.h unix/mphalport.h: Define mp_hal_stdio_poll to dummy because it's unused. 2019-10-29 22:22:37 +11:00
mpthreadport.c unix/mpthreadport: Use named semaphores on Mac OS X. 2019-03-27 10:50:01 +11:00
mpthreadport.h unix/mpthreadport: Add thread deinit code to stop threads on exit. 2019-01-27 12:38:23 +11:00
qstrdefsport.h ports: Make new ports/ sub-directory and move all ports there. 2017-09-06 13:40:51 +10:00
unix_mphal.c unix/unix_mphal: Include time.h for CLOCK_MONOTONIC. 2019-07-09 13:05:59 +10:00