python-guide

Installation
SKILL.md

Python Guide

Applies to: Python 3.11+, APIs, CLIs, Data Pipelines, Automation

Core Principles

  1. Type Hints Everywhere: All function signatures, class attributes, and module-level variables must have type annotations
  2. Explicit Over Implicit: No * imports, no mutable default arguments, no implicit type coercions
  3. Virtual Environments Always: Never install into system Python; use venv, uv, or poetry
  4. Pytest Over unittest: Use pytest for all testing; fixtures and parametrize over setUp/tearDown
  5. PEP 8 + Ruff: Enforce style mechanically; never rely on manual formatting

Guardrails

Python Version

  • Target Python 3.11+ (use match statements, ExceptionGroup, tomllib)
  • Set requires-python = ">=3.11" in pyproject.toml
  • Use from __future__ import annotations for forward references in 3.11
Related skills
Installs
11
Repository
ar4mirez/samuel
First Seen
Feb 20, 2026