operator-overloading

How to overload __init__ method based on argument type?

How to overload __init__ method based on argument type? Question: Let’s say I have a class that has a member called data which is a list. I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list. What’s your technique …

Total answers: 10