/oss · 1 merged

micropython/micropython

A small version of Python that runs on microcontrollers and other tiny devices.

the project on GitHub (opens in a new tab)
  1. 3 Nov 2026

    Counting an empty string matches Python when the range is backwards

    What was broken
    Counting an empty string with an end before the start returned 1. Regular Python returns 0. Bytes had the same problem.
    What I changed
    The shortcut for empty strings now only runs when the range is valid, so a backwards range counts nothing.
    Why it matters
    Code gets the same answer on a small device as it does in regular Python.

    see the code, #19826 (opens in a new tab)

← every project