Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ BetterCountMissing
Class
BetterCountMissing
example_code/item_048.py:120–126 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
118
119
print(
"Example 8"
)
120
class
BetterCountMissing:
121
def
__init__(self):
122
self.added = 0
123
124
def
__call__(self):
125
self.added += 1
126
return
0
127
128
counter = BetterCountMissing()
129
assert counter() == 0
Callers
1
item_048.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected