python-best-practices
Pythonic code with modern type hints, dataclasses, async patterns, packaging, and testing
Content Preview
---
name: python-best-practices
description: Pythonic code with modern type hints, dataclasses, async patterns, packaging, and testing
---
# Python Best Practices
## Type Hints (3.12+ Syntax)
```python
# Use built-in generics (3.9+), no need for typing.List, typing.Dict
def process_items(items: list[str]) -> dict[str, int]:
return {item: len(item) for item in items}
# Union with | syntax (3.10+)
def find_user(user_id: int) -> User | None:
...
# Type parameter syntax (3.12+)
type VecHow to Use
Recommended: Install to project (local)
mkdir -p .claude/skills
curl -o .claude/skills/python-best-practices.md \
https://raw.githubusercontent.com/rohitg00/awesome-claude-code-toolkit/main/skills/python-best-practices/SKILL.mdSkill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.
Alternative: Clone full repo
git clone https://github.com/rohitg00/awesome-claude-code-toolkitThen reference at skills/python-best-practices/SKILL.md
Related Skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
mcp-buildermcpbuilderpython
by Anthropic · anthropic-official-skills
using-tmux-for-interactive-commands
Use when you need to run interactive CLI tools (vim, git rebase -i, Python REPL, etc.) that require real-time input/output - provides tmux-based approach for controlling interactive sessions through detached sessions and send-keys
using-tmux-for-interactive-commandsusingtmuxfor
by Jesse Vincent · obra-superpowers-lab
claude-api
Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.
claude-apiclaudeapipython
by affaan-m · everything-claude-code
python-patterns
Pythonic イディオム、PEP 8標準、型ヒント、堅牢で効率的かつ保守可能なPythonアプリケーションを構築するためのベストプラクティス。
python-patternspythonpatterns
by affaan-m · everything-claude-code