wshobson avatar

Python Anti Patterns

A comprehensive code review checklist that catches the Python mistakes that actually matter in production. Covers infrastructure gotchas like double retry layers and scattered timeout logic, architectural problems like exposing ORM models directly through APIs, and resource management issues like blocking calls in async code. The quick checklist at the end is genuinely useful during code reviews. What I appreciate most is that it focuses on the anti-patterns that cause real operational pain, not just style issues. Each example shows both the problematic code and the fix, making it practical for teams establishing coding standards.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
5
skills.sh installs
13.8K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill python-anti-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Python Anti-Patterns Checklist

A reference checklist of common mistakes and anti-patterns in Python code. Review this before finalizing implementations to catch issues early.

When to Use This Skill

  • Reviewing code before merge
  • Debugging mysterious issues
  • Teaching or learning Python best practices
  • Establishing team coding standards
  • Refactoring legacy code

Note: This skill focuses on what to avoid. For guidance on positive patterns and architecture, see the python-design-patterns skill.

Infrastructure Anti-Patterns

Scattered Timeout/Retry Logic

# BAD: Timeout logic duplicated everywhere
def fetch_user(user_id):
    try:
        return requests.get(url, timeout=30)
    except Timeout:
        logger.warning("Timeout fetching user")
        return None

def fetch_orders(user_id):
    try:
        return requests.get(url, timeout=30)
    except Timeout:
        logger.warning("Timeout fetching orders")
        return None

Fix: Centralize in decorators or client wrappers.

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
Debugging, Python

More from wshobson/agents

All 174

Recommended

More Debugging
1wshobson avatarprotocol-reverse-engineeringwshobson/agentsMaster network protocol reverse engineering including packet analysis, protocol dissection, and custom protocol documentation. Use when analyzing network traffi13.5Kskills.sh installs
2googlechrome avatarchrome-extensionsgooglechrome/modern-web-guidanceBuild and publish Chrome Extensions using Manifest V3 best practices. Use this skill whenever the user asks to create, modify, debug, or understand Chrome brows12.8Kskills.sh installs
3github avatarwebapp-testinggithub/awesome-copilotToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br12.5Kskills.sh installs
4wshobson avatargo-concurrency-patternswshobson/agentsMaster Go concurrency with goroutines, channels, sync primitives, and context. Use when building concurrent Go applications, implementing worker pools, or debug11.7Kskills.sh installs
5wshobson avatarcqrs-implementationwshobson/agentsImplement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or build11.4Kskills.sh installs
6wshobson avatartemporal-python-testingwshobson/agentsTest Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setu11.3Kskills.sh installs