python-fundamentals-313
Installation
SKILL.md
Quick Reference
| Feature | Version | Syntax |
|---|---|---|
| Free-threading | 3.13t | python3.13t script.py |
| JIT compiler | 3.13 | PYTHON_JIT=1 python3.13 script.py |
| Pattern matching | 3.10+ | match x: case {...}: |
| Walrus operator | 3.8+ | if (n := len(x)) > 10: |
| Type params | 3.12+ | def first[T](items: list[T]) -> T: |
| Type alias | 3.12+ | type Point = tuple[float, float] |
| Construct | Code | Use Case |
|---|---|---|
| Exception Group | ExceptionGroup("msg", [e1, e2]) |
Multiple errors |
| except* | except* ValueError as eg: |
Handle groups |
| @dataclass(slots=True) | Memory efficient | High-volume objects |
| StrEnum | class Status(StrEnum): |
String enums 3.11+ |