You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decorators in Python are functions that allow you to modify or extend the behavior of other functions or methods without altering their code. A decorator works by wrapping the original function in a "wrapper" function, which can execute additional code before and/or after calling the original function.
We also discuss some non-obvious uses of decorators. For example, decorators can implement memoization, caching the results of function calls or even make a function self-destruct after one use. Additionally, decorators can simulate retry logic by automatically retrying a function if it fails, which is especially useful for network requests.
Title
Decorators and their uses in python
Describe your Talk
Decorators in Python are functions that allow you to modify or extend the behavior of other functions or methods without altering their code. A decorator works by wrapping the original function in a "wrapper" function, which can execute additional code before and/or after calling the original function.
We also discuss some non-obvious uses of decorators. For example, decorators can implement memoization, caching the results of function calls or even make a function self-destruct after one use. Additionally, decorators can simulate retry logic by automatically retrying a function if it fails, which is especially useful for network requests.
Pre-requisites & reading material
Preread:
Code examples:
https://github.com/virajsharma2000/python_apps/tree/main/decorators/decorator
Time required for the talk
10-15 minutes
Link to slides/demos
https://docs.google.com/presentation/d/1imSOgDvd-Zk0TX3Wx2wYFgcgqlwPM4UQVzmfX_uIwCs/edit?usp=sharing
About you
Hi I am Viraj, I love writing python code and learning about new features in the language
Availability
16/11/2024
Any comments
Excited to be talking about this
The text was updated successfully, but these errors were encountered: