Python does not explicitly support multiple constructors in class. But there are ways you can provision a class with multiple constructors.
- Constructor Overloading using arguments
- Calling methods from constructors
- Using Class Method decorator
Constructor Overloading using arguments
Constructor overloading can be achieved using the same __init__ method and writing the functionality in the constructor method based on arguments.
See below example-
Calling methods from constructors
Same as above example the below example calls the method from the constructor based on the isntance of the argument.