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

Method update

python/bplustree/__init__.py:85–98  ·  view source on GitHub ↗

Update tree with key-value pairs from other mapping or iterable.

(self, other)

Source from the content-addressed store, hash-verified

83 return default
84
85 def update(self, other):
86 """Update tree with key-value pairs from other mapping or iterable."""
87 if hasattr(other, "items"):
88 # other is a mapping (dict-like)
89 for key, value in other.items():
90 self[key] = value
91 elif hasattr(other, "keys"):
92 # other has keys method but no items (like dict.keys())
93 for key in other.keys():
94 self[key] = other[key]
95 else:
96 # other is an iterable of (key, value) pairs
97 for key, value in other:
98 self[key] = value
99
100 def copy(self):
101 """Create a shallow copy of the tree."""

Callers 15

demo_api_compatibilityFunction · 0.95
demo_basic_range_queriesFunction · 0.95
mainFunction · 0.95
benchmark_range_queriesFunction · 0.95
benchmark_iterationFunction · 0.95
benchmark_memory_usageFunction · 0.95
capacity_tuning_demoFunction · 0.95
test_generate_gprofFunction · 0.45
test_update_with_dictMethod · 0.45

Calls 2

itemsMethod · 0.45
keysMethod · 0.45