Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides Python idioms for type-first, functional, and error-handling patterns in .py, pyproject.toml, and requirements.txt files.
83% 100%+17 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 19 of 23 without it.
3 of 3 safety checks passed
Not used yet
Follows type-first, functional, and error handling patterns from CLAUDE.md. This skill covers language-specific idioms only.
Use Python's type system to prevent invalid states at type-check time.
Frozen dataclasses for immutable domain models:
from dataclasses import dataclass
from datetime import datetime
@dataclass(frozen=True)
class User:
id: str
email: str
name: str
created_at: datetime
# Frozen dataclasses are immutable — no accidental mutation
Discriminated unions with Literal:
from dataclasses import dataclass
from typing import Literal
@dataclass
class Success:
status: Literal["success"] = "success"
data: str
@dataclass
class Failure:
status: Literal["error"] = "error"
error: Exception
RequestState = Success | Failure
Next to this one in the catalogue, plus more from the same author.