MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / __len__

Method __len__

python/bplustree/bplus_tree.py:247–249  ·  view source on GitHub ↗

Return number of key-value pairs

(self)

Source from the content-addressed store, hash-verified

245 return exists
246
247 def __len__(self) -> int:
248 """Return number of key-value pairs"""
249 return self.leaves.key_count()
250
251 def __bool__(self) -> bool:
252 """Return True if tree is not empty"""

Callers

nothing calls this directly

Calls 1

key_countMethod · 0.80

Tested by

no test coverage detected