EN: The Leaf class represents the end objects of a composition. A leaf can't have any children. Usually, it's the Leaf objects that do the actual work, whereas Composite objects only delegate to their sub-components. RU: Класс Лист представляет собой конечные объекты структуры
| 91 | |
| 92 | |
| 93 | class Leaf(Component): |
| 94 | """ |
| 95 | EN: The Leaf class represents the end objects of a composition. A leaf can't |
| 96 | have any children. |
| 97 | |
| 98 | Usually, it's the Leaf objects that do the actual work, whereas Composite |
| 99 | objects only delegate to their sub-components. |
| 100 | |
| 101 | RU: Класс Лист представляет собой конечные объекты структуры. Лист не может |
| 102 | иметь вложенных компонентов. |
| 103 | |
| 104 | Обычно объекты Листьев выполняют фактическую работу, тогда как объекты |
| 105 | Контейнера лишь делегируют работу своим подкомпонентам. |
| 106 | """ |
| 107 | |
| 108 | def operation(self) -> str: |
| 109 | return "Leaf" |
| 110 | |
| 111 | |
| 112 | class Composite(Component): |