MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / Component

Class Component

src/Visitor/Conceptual/main.py:18–29  ·  view source on GitHub ↗

EN: The Component interface declares an `accept` method that should take the base visitor interface as an argument. RU: Интерфейс Компонента объявляет метод accept, который в качестве аргумента может получать любой объект, реализующий интерфейс посетителя.

Source from the content-addressed store, hash-verified

16
17
18class Component(ABC):
19 """
20 EN: The Component interface declares an `accept` method that should take the
21 base visitor interface as an argument.
22
23 RU: Интерфейс Компонента объявляет метод accept, который в качестве
24 аргумента может получать любой объект, реализующий интерфейс посетителя.
25 """
26
27 @abstractmethod
28 def accept(self, visitor: Visitor) -> None:
29 pass
30
31
32class ConcreteComponentA(Component):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected