‹ 首页

switchlang

@mikeckennedy · 收录于 今天 · 上游提交 1 个月前

Adds switch blocks to the Python language. Use when writing Python code that uses the switchlang package.

适合你,如果写 Python 时想要更简洁的多分支语法。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add mikeckennedy/python-switch/switchlang
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- mikeckennedy/python-switch/switchlang
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify mikeckennedy/python-switch/switchlang
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
251GitHub stars
~216上下文体积 · 单文件
索引托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 721b0ac

switchlang

Adds switch blocks to the Python language.

Installation
pip install switchlang
API overview
The switch block

The context manager that gives Python an explicit switch statement. Use it in a with block, register cases, then read result.

  • switch: An explicit switch statement for Python, implemented as a context manager
Range helpers

Helpers for mapping ranges of values to a single case.

  • closed_range: Create a closed range for a case: both start and stop are included
Resources
  • Full documentation
  • [llms.txt](llms.txt) — Indexed API reference for LLMs
  • [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
  • Source code
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。