Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed as not planned
Description
I'm learning about Python decorators and would appreciate feedback on my implementation.
Here's my example code:
@timerdefslow_function():importtimetime.sleep(2)return"Done"
Specifically, I'd like to know:
- Is this a correct usage of decorators?
- What's missing from the implementation (I notice the
@timer
decorator itself isn't defined) - Best practices for implementing timing decorators
Thank you for your help!
Metadata
Metadata
Assignees
Labels
No labels