MCPcopy Index your code
hub / github.com/nodejs/node / __setitem__

Method __setitem__

tools/inspector_protocol/jinja2/utils.py:414–427  ·  view source on GitHub ↗

Sets the value for an item. Moves the item up so that it has the highest priority then.

(self, key, value)

Source from the content-addressed store, hash-verified

412 self._wlock.release()
413
414 def __setitem__(self, key, value):
415 """Sets the value for an item. Moves the item up so that it
416 has the highest priority then.
417 """
418 self._wlock.acquire()
419 try:
420 if key in self._mapping:
421 self._remove(key)
422 elif len(self._mapping) == self.capacity:
423 del self._mapping[self._popleft()]
424 self._append(key)
425 self._mapping[key] = value
426 finally:
427 self._wlock.release()
428
429 def __delitem__(self, key):
430 """Remove an item from the cache dict.

Callers

nothing calls this directly

Calls 2

acquireMethod · 0.80
releaseMethod · 0.80

Tested by

no test coverage detected