Since Python is a duck-typed language is writing factory classes meaningless in Python?
http://en.wikipedia.org/wiki/Factory_method_pattern
Since Python is a duck-typed language is writing factory classes meaningless in Python? http://en.wikipedia.org/wiki/Factory_method_pattern
Share
While there may be times when the factory pattern is unnecessary where it may be required in other languages, there are still times when it would be valid to use it – it might just be a way of making your API cleaner – for example as a way of preventing duplication of code that decides which of a series of subclasses to return.
From the Wikipedia article you linked:
All of these can still apply when the language is duck typed.