Skillshub python

Python 3.11 Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/python" ~/.claude/skills/comeonoliver-skillshub-python && rm -rf "$T"
manifest: skills/pproenca/dot-skills/python/SKILL.md
source content

Python 3.11 Best Practices

Comprehensive performance optimization guide for Python 3.11+ applications. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Python async I/O code
  • Choosing data structures for collections
  • Optimizing memory usage in data-intensive applications
  • Implementing concurrent or parallel processing
  • Reviewing Python code for performance issues

Rule Categories by Priority

PriorityCategoryImpactPrefix
1I/O & Async PatternsCRITICAL
io-
2Data Structure SelectionCRITICAL
ds-
3Memory OptimizationHIGH
mem-
4Concurrency & ParallelismHIGH
conc-
5Loop & IterationMEDIUM
loop-
6String OperationsMEDIUM
str-
7Function & Call OverheadLOW-MEDIUM
func-
8Python Idioms & MicroLOW
py-

Table of Contents

  1. I/O & Async PatternsCRITICAL

  2. Data Structure SelectionCRITICAL

  3. Memory OptimizationHIGH

  4. Concurrency & ParallelismHIGH

  5. Loop & IterationMEDIUM

  6. String OperationsMEDIUM

  7. Function & Call OverheadLOW-MEDIUM

  8. Python Idioms & MicroLOW

References

  1. Python 3.11 Release Notes
  2. PEP 8 Style Guide
  3. Python Wiki - Performance Tips
  4. Real Python - Async IO
  5. Real Python - LEGB Rule
  6. Real Python - String Concatenation
  7. Python Tutorial - Data Structures
  8. CPython Exception Handling
  9. DataCamp - Python Generators
  10. JetBrains - Performance Hacks