Create custom decorators for logging, caching, validation, and more.
Help me create Python decorators for: [DESCRIBE YOUR NEEDS] Decorator types needed: - [ ] Function decorator - [ ] Class decorator - [ ] Decorator with arguments - [ ] Decorator that preserves function signature - [ ] Stacked decorators Use cases: 1. Logging and timing 2. Caching/memoization 3. Input validation 4. Authentication/authorization 5. Rate limiting 6. Retry logic 7. Deprecation warnings 8. Type checking 9. Singleton pattern 10. Registry pattern For each decorator, provide: - Implementation with functools.wraps - Type hints - Usage examples - Edge cases handled - Testing approach
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[DESCRIBE YOUR NEEDS]