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

Function client_code

src/Visitor/Conceptual/main.py:138–152  ·  view source on GitHub ↗

EN: The client code can run visitor operations over any set of elements without figuring out their concrete classes. The accept operation directs a call to the appropriate operation in the visitor object. RU: Клиентский код может выполнять операции посетителя над любым набором

(components: List[Component], visitor: Visitor)

Source from the content-addressed store, hash-verified

136
137
138def client_code(components: List[Component], visitor: Visitor) -> None:
139 """
140 EN: The client code can run visitor operations over any set of elements
141 without figuring out their concrete classes. The accept operation directs a
142 call to the appropriate operation in the visitor object.
143
144 RU: Клиентский код может выполнять операции посетителя над любым набором
145 элементов, не выясняя их конкретных классов. Операция принятия направляет
146 вызов к соответствующей операции в объекте посетителя.
147 """
148
149 # ...
150 for component in components:
151 component.accept(visitor)
152 # ...
153
154
155if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 1

acceptMethod · 0.45

Tested by

no test coverage detected