Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Decorators
Why should a transparent decorator for async def usually return an async def wrapper?
from Decorators
Python 3.14
intermediate
1 min
Why should a transparent decorator for async def usually return an async def wrapper?
So the wrapper can await execution inside its exception and cleanup boundary
Because functools.wraps() works only on async functions
Because async wrappers execute at module import time
So callers no longer need to await the decorated function
Check
Ask AI about this kata
Report an error
next kata
For @retry_on(ConnectionError, attempts=3), what must retry_on(...) return?
Quiz
A new version is available
Reload