mikeckennedy · GitHub

Commits on Jun 11, 2026

  1. Configuration menu

    Browse the repository at this point in the history

  2. Complete type hints, refresh docstrings and README, rebuild docs" -m …

    …"Fully annotate the public API now that py.typed ships: case() -> bool
    (normalized to always return a bool), __enter__/__exit__, result, and
    closed_range, using 3.9-safe modern annotation syntax.
    Rewrite the docstrings that render as the API reference, fixing the
    context-manager description, default() ordering caveat, case() return
    contract, fall-through result semantics, and closed_range wording.
    README: version + docs badges with a link to the hosted docs, uv install
    option, corrected feature list with s.result, new fall-through/results
    and 'Why not just match?' sections, f-strings throughout.
    Tooling: ruff target-version py39 to match requires-python; add PyPI
    keywords and mark the project production/stable. Rebuild the docs site.
    Closes #13
    Configuration menu

    Browse the repository at this point in the history

  3. Fix closed_range step overshoot and result sentinel comparison

    closed_range() built its inclusive bound as stop + step, so any step
    greater than 1 overshot: closed_range(1, 6, 2) produced 1, 3, 5, 7 and
    values outside the stated range could match a case. Build the range
    with stop + 1 instead, and reject step < 1 with a clear ValueError.
    First tests with a non-default step.
    .result compared its no-result sentinel with == instead of is, so a
    matched case returning an always-equal object (numpy arrays are the
    real-world case) raised "No result has been computed". Compare by
    identity, with an assertIs regression test.
    Rebuild the docs for the updated closed_range reference; every page
    also picks up the just-added Umami analytics snippet. Ignore uv.lock.
    Closes #14
    Configuration menu

    Browse the repository at this point in the history

  4. Add behavior tests pinning documented guards and semantics

    Seven new tests (29 total) for documented-but-untested behavior:
    the closed_range start/stop guard, adjacent closed ranges raising
    duplicate-case, exception propagation from the block body and from
    case actions, the default-before-case ordering quirk, non-callable
    case actions, and None as a legitimate result. Takes switchlang to
    100% line coverage.
    Configuration menu

    Browse the repository at this point in the history

  5. Configuration menu

    Browse the repository at this point in the history

Read the original on github.com ↗