Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz/python-cookbook
/ example.py
File
example.py
src/8/implementing_the_visitor_pattern/example.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
# Example of the visitor pattern
2
3
# --- The following classes represent nodes in an expression tree
4
class
Node:
Callers
nothing calls this directly
Calls
9
StackCode
Class · 0.85
generate_code
Method · 0.80
Sub
Class · 0.70
Number
Class · 0.70
Mul
Class · 0.70
Div
Class · 0.70
Add
Class · 0.70
Evaluator
Class · 0.70
visit
Method · 0.45
Tested by
no test coverage detected