mirror of
https://github.com/rjNemo/design-patterns
synced 2026-06-06 02:26:40 +00:00
14 lines
358 B
Python
14 lines
358 B
Python
from component import Component
|
|
|
|
|
|
class Leaf(Component):
|
|
"""
|
|
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.
|
|
"""
|
|
|
|
def operation(self) -> str:
|
|
return "Leaf"
|