Factory method for objects – best practice?
First, most of the time you think you need something like this, you don’t; it’s a sign that you’re trying to treat Python like Java, and the solution is to step back and ask why you need a factory. Often, the simplest thing to do is to just have a constructor with defaulted/optional/keyword arguments. Even … Read more