← ClaudeAtlas

python-code-stylelisted

Python coding conventions that follow established industry standards: PEP 8, PEP 257, the Google Python Style Guide, and the Python typing team's best practices. Covers tooling, imports, naming, language features, exceptions, resources, strings, logging, type annotations, docstrings and comments. TRIGGER when: writing, editing, or generating any Python code. DO NOT TRIGGER when: only reading or analyzing code without making changes, or working in a non-Python language.
contrastiskey/eetc-claude-code · ★ 0 · Code & Development · score 65
Install: claude install-skill contrastiskey/eetc-claude-code
# Python Code Style Sources. Earlier ones win a disagreement: 1. [PEP 8](https://peps.python.org/pep-0008/) and [PEP 257](https://peps.python.org/pep-0257/): Python's own style and docstring conventions. 2. [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html). 3. [Typing best practices](https://typing.python.org/en/latest/reference/best_practices.html) from the Python typing team. Framework rules live in `eetc:fastapi-patterns` / `eetc:django-patterns`. Project-specific commands live in the repo's CLAUDE.md. ## Tooling - The repo's linter (ruff, pylint, flake8) and type checker (mypy, pyright, pyrefly) pass. Never loosen their config to get a change through. - A suppression is line-level, names the rule, and says why when the rule name doesn't: `x = lookup() # type: ignore[no-untyped-call] # vendored, no stubs`. - The formatter (ruff format, black, pyink) owns line length, quotes, wrapping and trailing commas. Run it on the files you touch and don't hand-format against it. With no formatter: 4-space indents, 80 columns, one quote character per file, and no backslash line continuations (wrap inside parentheses instead). - Check `requires-python` in `pyproject.toml` before using newer syntax: | Feature | Python | |---------|--------| | `list[int]`, `dict[str, int]` in annotations | 3.9 | | `X \| None`, `match` | 3.10 | | `typing.Self`, `except*` | 3.11 | | `typing.override`, `type Alias = ...`, `def f[T](...)`