Explain how to overload constructors or methods in Python.
Virgilio D.
answered 05/16/18
Senior Software Engineer Specializing in Python.
- Use @classmethod as a wrapper around the method that will be used to overload the __init__ (constructor)
- Use a parameter with a default value, so you can call this method with or without the param which effectively overloads.
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.