micropython/tests/unicode
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
..
data
file1.py
file2.py
unicode.py py/unicode: Fix check for valid utf8 being stricter about contn chars. 2018-11-26 16:13:08 +11:00
unicode_chr.py
unicode_id.py py: Support unicode (utf-8 encoded) identifiers in Python source. 2015-06-09 10:58:07 +00:00
unicode_index.py
unicode_iter.py
unicode_ord.py
unicode_pos.py
unicode_slice.py py/objslice: Add support for indices() method on slice objects. 2019-12-28 23:55:15 +11:00
unicode_str_format.py py/objstr: Make string formatting 8-bit clean. 2015-08-29 23:13:51 +01:00
unicode_str_modulo.py py/objstr: Make string formatting 8-bit clean. 2015-08-29 23:13:51 +01:00
unicode_subscr.py tests/unicode_subscr.py: Detailed test for subscripting unicode strings. 2016-07-25 19:28:19 +03:00