Use when implementing advanced Python decorators.
Scanned 9/10/2026
Install to Claude Code
npx -y skills add LoopyLuci/Skills --skill python-decorators-advanced --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Python Decorators Advanced?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/loopyluci-python-decorators-advanced)More formats (shields.io, HTML) on the badges page.
---
name: python-decorators-advanced
description: "Use when implementing advanced Python decorators."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
hermes:
tags: [python, decorators, functools, wraps, class-decorators]
related_skills: [python-async-patterns, clean-code-principles, cross-thread-async]
---
# Advanced Python Decorators
Implementing advanced Python decorators — from parameterized decorators through class decorators, decorators with arguments, and stacked patterns.
## When to Use
- Building reusable cross-cutting concerns
- Implementing caching, retry, timing decorators
- Building DSL-like APIs with decorators
## Decorator Patterns
```python
from functools import wraps
import time
def retry(max_attempts=3, delay=1):
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
for i in range(max_attempts):
try: return func(*args, **kwargs)
except Exception as e:
if i == max_attempts - 1: raise
time.sleep(delay)
return None
return wrapper
return decorator
def timer(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
print(f"{func.__name__}: {time.time()-start:.3f}s")
return result
return wrapper
```
## Verification Checklist
- [ ] @wraps used to preserve metadata
- [ ] Decorator factory with arguments pattern
- [ ] Stacking decorators in correct order
- [ ] Class-based decorators with __call__
- [ ] Async decorator support
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!