Skip to content

v0.1.0

Choose a tag to compare

@mikeckennedy mikeckennedy released this 07 Nov 18:49
· 18 commits to master since this release

Initial public release of switchlang on PyPI: an explicit switch block for Python built on the with statement.

Added

  • switch(value) context manager with case() and default() registration; cases run on block exit.
  • Duplicate-case detection (ValueError) and validation that case actions are callable.
  • List and range keys so one action can serve several values; empty collections are rejected (#8).
  • Opt-in fall-through per case via fallthrough=True.
  • switch.result to read the matched case's return value after the block.
  • closed_range(start, stop) helper, inclusive on both ends.
  • Packaged as switchlang with a setup.py for installation from PyPI (#5, #11).

Published to PyPI on 2020-03-20 (https://pypi.org/project/switchlang/0.1.0/). This GitHub release was created retroactively on 2026-11-07 so every PyPI release has a matching tag and release; the tag points at the exact commit the PyPI sdist was built from.