
Python Best Practices
This is a comprehensive Python style guide distilled from real PR review patterns, covering 70 rules across data modeling, error handling, type safety, and API design. It assumes Python 3.11+ and includes impact ratings so you know what matters (like fixing mutable defaults and catching specific exceptions) versus what's just preference (like naming conventions). The rules are pragmatic about when to apply them: new code gets the full treatment, but stable code shouldn't be churned for style points. Worth having on hand if you're doing code reviews or want to stop debating the same patterns repeatedly. The discriminated unions and timezone-aware datetime guidance alone will save you from common footguns.
- skills.sh installs
- 868
- GitHub stars
- 3
- last updated
- Aug 21, 2026
Install
$ npx -y skills add nathan-gage/python-skills --skill python-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Python Best Practices
Guidelines for writing and reviewing Python. 75 rules across 8 categories, prioritized by impact.
A rule match is a signal, not a verdict. Most rules are design preferences for new code, not bugs to fix across the repo — check the rule's impact level before flagging in review or refactoring stable code.
Quick-reference lines are triggers, not licenses: before applying a rule as a review finding or a transformation, open the rule file and check its counter-signal — the marker-opened paragraph (**When ...** / **Scope:** / **Preserve ...**) saying when NOT to apply it.
When to Apply
- Writing new Python modules, functions, classes, or data models
- Reviewing code for correctness or type safety
- Refactoring patterns in code that's being edited anyway
Avoid applying these rules as a blanket sweep across stable code — the churn rarely pays off.
Impact Levels
Sponsors
Details
- Repository
- github.com/nathan-gage/python-skills
- Categories
- Backend & APIs, Git & Pull Requests, Documentation, Code Review & Quality, Debugging, Python, Design & UI/UX
- First seen
- Jun 3, 2026