← ClaudeAtlas

pro-pythonlisted

Comprehensive knowledge base and design pattern manual from "Pro Python" by Marty Alchin (Apress), fully modernized for Python 3.10–3.13+. Use when applying advanced OOP frameworks (Metaclasses, __init_subclass__, Descriptors, MRO/super(), Dunder Protocols vs typing.Protocol, Decorator architecture, Memory Management, and Declarative Framework Design).
psthi/pro-python-skill · ★ 0 · AI & Automation · score 55
Install: claude install-skill psthi/pro-python-skill
# Pro Python (Modernized Knowledge Base) 🐍✨ **Author**: Marty Alchin | **Scope**: Foundational Python OOP + Modern Python 3.10–3.13+ Bridges | **Chapters**: 12 --- ## 🧭 How to Use This Skill - **General Architectural Guidance**: Query core Python OOP principles, MRO resolution, or decorator mechanics. - **Topic-Specific Retrieval**: Ask about `decorators`, `metaclasses`, `__init_subclass__`, `protocols`, `descriptors`, `caching`, or `MRO`; the relevant chapter file is pulled on-demand. - **Direct Chapter Inspection**: Request specific chapters (e.g. `ch04` for Classes/MRO, `ch11` for Declarative CSV Framework, `ch12` for Modern Python 3.10–3.13 Bridge). --- ## 🧠 Core Frameworks & Mental Models 1. **Zen of Python (Ch 1)**: 19 design aphorisms (`import this`, PEP 20) used as an engineering checklist. Key principles: *"Errors should never pass silently"*, *"In the face of ambiguity, refuse the temptation to guess"*, and *"Simple is better than complex"*. 2. **The Samurai Principle**: Functions must raise explicit exceptions rather than returning ambiguous sentinels (e.g. `None`) on failure when `None` could be a legitimate return value. 3. **Closures, Decorators & Type Preservation (Ch 3 & 12)**: Optional-argument decorator pattern (`func=None`, keyword-only options) combined with `functools.wraps` and `typing.ParamSpec` for complete runtime and static type preservation. 4. **Method Resolution Order & Cooperative `super()` (Ch 4)**: C3 linearization flattens multiple-i