MCPcopy Create free account
hub / github.com/PyTables/PyTables / _DictCache

Class _DictCache

tables/file.py:350–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349
350class _DictCache(dict):
351 def __init__(self, nslots: int) -> None:
352 if nslots < 1:
353 raise ValueError("Invalid number of slots: %d" % nslots)
354 self.nslots = nslots
355 super().__init__()
356
357 def __setitem__(self, key: Any, value: Any) -> None:
358 # Check if we are running out of space
359 if len(self) > self.nslots:
360 warnings.warn(
361 "the dictionary of node cache is exceeding the recommended "
362 "maximum number (%d); be ready to see PyTables asking for "
363 "*lots* of memory and possibly slow I/O." % (self.nslots),
364 PerformanceWarning,
365 )
366 super().__setitem__(key, value)
367
368
369class NodeManager:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected