I have two inherited classes in a module shape.py :
class Shape(object):
class Triangle(Shape):
class Square(Shape):
In my main code I want to instantiate a Shape
but I don't know what kind of shape it will be. The shape depends on a user input or a setting.
What would be the best way to get the right instance according to a setting or a user input in Python ?