SKILL

python-patterns

Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications. Use when writing or reviewing Python code and idiomatic structure, typing, or PEP 8 is in question.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Python Development Patterns
  • When to Activate
  • Core Principles
  • 1. Readability Counts
  • 2. Explicit is Better Than Implicit
  • 3. EAFP - Easier to Ask Forgiveness Than Permission
  • Type Hints
  • Basic Type Annotations

Idiomatic Python patterns and best practices for building robust, efficient, and maintainable applications. Writing new Python code Reviewing Python code Refactoring existing Python code Designing Python packages/modules Python prioritizes readability. Code should be obvious and easy to understand. Avoid magic; be clear about what your code does. Python prefers exception handling over checking conditions. | Idiom | Description | |-------|-------------| | EAFP | Easier to Ask Forgiveness than Permission | | Context managers | Use with for resource management | | List comprehensions | For simple transformations | | Generators | For lazy evaluation and large datasets | | Type hints | Annotate function signatures | | Dataclasses | For data containers with auto-generated methods | | slots | For memory optimization | | f-strings | For string formatting (Python 3.6+) | | pathlib.Path | For path operations (Python 3.4+) | | enumerate | For index-element pairs in loops | Remember: Python code should be readable, explicit, and follow the principle of least surprise. When in doubt, prioritize clarity over cleverness.

Source repository
affaan-m/ECC
Source file
pi/core/skills/python-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.197Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.