0157-python-resource-management
CommunityReliably clean up resources with context managers
AuthorMrJmpl3
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps you prevent resource leaks and unstable behavior by ensuring connections, file handles, and streams are cleaned up deterministically even when errors occur.
Core Features & Use Cases
- Sync context managers: Use
withplus__enter__/__exit__to guarantee unconditional cleanup of acquired resources. - Async context managers: Use
async withplus__aenter__/__aexit__to manage pooled or transactional async resources safely. - Operational patterns for robustness: Choose when to suppress specific exceptions (e.g., client disconnects), accumulate streaming state efficiently, and manage a dynamic set of resources via
ExitStack/AsyncExitStack.
Quick Start
Use the 0157-python-resource-management skill to wrap a database connection or file handle in a context manager so it is always released, even if your code raises an exception.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 0157-python-resource-management Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0157-python-resource-management Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.