MCPcopy 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

140print("Example 10")
141class SequenceNode(IndexableNode):
142 def __len__(self):
143 count = 0
144 for _ in self._traverse():
145 count += 1
146 return count
147
148
149print("Example 11")

Callers

nothing calls this directly

Calls 1

_traverseMethod · 0.45

Tested by

no test coverage detected