Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ __len__
Method
__len__
example_code/item_057.py:142–146 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
140
print(
"Example 10"
)
141
class
SequenceNode(IndexableNode):
142
def
__len__(self):
143
count = 0
144
for
_ in self._traverse():
145
count += 1
146
return
count
147
148
149
print(
"Example 11"
)
Callers
nothing calls this directly
Calls
1
_traverse
Method · 0.45
Tested by
no test coverage detected