I'm trying to understand and use factory pattern like:
class Factory(): @staticmethod def getObj(): return Drive() class Drive(): def select(): print('select method from Drive class called') obj = Factory.getObj() obj.select()But it throws an error:
Error:TypeError: select() takes 0 positional arguments but 1 was given
Please help me understanding and using factory pattern.