EN: The client code works with an instance of a concrete creator, albeit through its base interface. As long as the client keeps working with the creator via the base interface, you can pass it any creator's subclass. RU: Клиентский код работает с экземпляром конкретного создателя,
(creator: Creator)
| 129 | |
| 130 | |
| 131 | def client_code(creator: Creator) -> None: |
| 132 | """ |
| 133 | EN: The client code works with an instance of a concrete creator, albeit |
| 134 | through its base interface. As long as the client keeps working with the |
| 135 | creator via the base interface, you can pass it any creator's subclass. |
| 136 | |
| 137 | RU: Клиентский код работает с экземпляром конкретного создателя, хотя и |
| 138 | через его базовый интерфейс. Пока клиент продолжает работать с создателем |
| 139 | через базовый интерфейс, вы можете передать ему любой подкласс создателя. |
| 140 | """ |
| 141 | |
| 142 | print(f"Client: I'm not aware of the creator's class, but it still works.\n" |
| 143 | f"{creator.some_operation()}", end="") |
| 144 | |
| 145 | |
| 146 | if __name__ == "__main__": |