EN: The client code works with all objects using the Component interface. This way it can stay independent of the concrete classes of components it works with. RU: Клиентский код работает со всеми объектами, используя интерфейс Компонента. Таким образом, он остаётся независимым
(component: Component)
| 107 | |
| 108 | |
| 109 | def client_code(component: Component) -> None: |
| 110 | """ |
| 111 | EN: The client code works with all objects using the Component interface. |
| 112 | This way it can stay independent of the concrete classes of components it |
| 113 | works with. |
| 114 | |
| 115 | RU: Клиентский код работает со всеми объектами, используя интерфейс |
| 116 | Компонента. Таким образом, он остаётся независимым от конкретных классов |
| 117 | компонентов, с которыми работает. |
| 118 | """ |
| 119 | |
| 120 | # ... |
| 121 | |
| 122 | print(f"RESULT: {component.operation()}", end="") |
| 123 | |
| 124 | # ... |
| 125 | |
| 126 | |
| 127 | if __name__ == "__main__": |