Python
Write reliable Python avoiding mutable defaults, import traps, and common runtime surprises.
Why use this skill?
Master Python with OpenClaw. Avoid mutable default traps, concurrency bottlenecks, and import errors with this professional-grade skill for clean, robust development.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/pyWhat This Skill Does
The Python skill for OpenClaw provides high-level technical guidance, code generation, and debugging assistance for Python developers. It acts as a specialized assistant designed to help you avoid the common pitfalls and runtime surprises inherent in the language. By internalizing best practices—such as avoiding mutable defaults, correctly handling circular imports, and managing context managers for file I/O—this skill ensures that your code is not only functional but also maintainable and robust. It covers critical areas including memory management, threading, and advanced object-oriented design.
Installation
To integrate this skill into your environment, run the following command in your terminal:
clawhub install openclaw/skills/skills/ivangdavila/py
Use Cases
- Code Refactoring: Transform legacy Python code that contains hidden bugs like mutable default arguments or race conditions.
- Architecture Design: Receive advice on complex scenarios like handling circular dependencies or structuring large packages using
__init__.pyfiles. - Performance Tuning: Get recommendations for choosing between
threadingandmultiprocessingbased on your application's I/O or CPU-bound nature. - Bug Hunting: Quickly diagnose runtime errors like
UnboundLocalErroror floating-point precision issues with currency.
Example Prompts
- "I am having trouble with a shared list in my class. Can you explain why my class attributes are leaking between instances and how to fix it?"
- "Write a secure function to read and parse a CSV file that handles file encoding properly and ensures the file handle is closed even if an exception occurs."
- "My multi-threaded scraper is running slower than expected despite having more CPU cores. Is the GIL causing this, and should I switch to a multiprocessing approach?"
Tips & Limitations
- Memory Awareness: Remember that Python generators are exhausted after a single iteration. If you need to consume data multiple times, use
itertools.teeor convert the generator to a list. - Precision: Always use the
decimalmodule for financial calculations, as native floats will introduce rounding errors that break arithmetic logic. - Safety: While this agent provides high-quality code, always run generated snippets in a sandboxed environment before deploying to production. Avoid using bare
except:blocks, as they mask critical system signals.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-py": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.