Code generated in the video can be downloaded from here:
https://github.com/bnsreenu/python_for_microscopists
Dataset:
https://www.kaggle.com/uciml/pima-indians-diabetes-database
A decorator in python allows us to add new functionality to an existing
object (function or class) by not requiring us to modify the object's structure.
Decorators allow us to wrap another function to extend the behavior of the wrapped function, without permanently modifying it. They are typically called before defining another function that we'd like to decorate.
Functions are first-class objects in python. This means they support
the following operations.
- Stored in a variable.
- Passed as an argument to another function.
- Defined inside another function.
- Returned from another function.
- Store in data structures such as lists.
Decorators leverage this behavior of functions.
Download
0 formats
No download links available.
Tips Tricks 17 - All you need to know about decorators in python | NatokHD