switchlang
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上下文体积 · 单文件
索引托管
怎么用
商店整理自技能原文 · 版本 721b0ac · 表述以原文为准它做什么
安装后,Claude 会在 Python 代码中使用 switchlang 包时,自动添加 switch 语句块,支持用 with 块注册多个 case 并读取 result。
什么时候触发
当你在 Python 代码中导入或使用 switchlang 包时触发。
装好后可以这样说
Claude 会生成带 case 的 switch 块。
Claude 会使用 closed_range 辅助函数。
技能原文 SKILL.md
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: bothstartandstopare 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 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…