Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ LineCountWorker
Class
LineCountWorker
example_code/item_052.py:81–87 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
79
80
print(
"Example 4"
)
81
class
LineCountWorker(Worker):
82
def
map(self):
83
data = self.input_data.read()
84
self.result = data.count(
"\n"
)
85
86
def
reduce(self, other):
87
self.result += other.result
88
89
90
print(
"Example 5"
)
Callers
1
create_workers
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected