Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CarFactory(ABC):
- @abstractmethod
- def create_car(self):
- pass
- class ElectricCarFactory(CarFactory):
- def __init__(self, prototype):
- self.prototype = prototype
- def create_car(self):
- return self.prototype.clone()
- class GasolineCarFactory(CarFactory):
- def __init__(self, prototype):
- self.prototype = prototype
- def create_car(self):
- return self.prototype.clone()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement