MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/weakref.py:367–385  ·  view source on GitHub ↗
(self, dict=None)

Source from the content-addressed store, hash-verified

365 """
366
367 def __init__(self, dict=None):
368 self.data = {}
369 def remove(k, selfref=ref(self)):
370 self = selfref()
371 if self is not None:
372 if self._iterating:
373 self._pending_removals.append(k)
374 else:
375 try:
376 del self.data[k]
377 except KeyError:
378 pass
379 self._remove = remove
380 # A list of dead weakrefs (keys to be removed)
381 self._pending_removals = []
382 self._iterating = set()
383 self._dirty_len = False
384 if dict is not None:
385 self.update(dict)
386
387 def _commit_removals(self):
388 # NOTE: We don't need to call this method before mutating the dict,

Callers

nothing calls this directly

Calls 2

updateMethod · 0.95
setFunction · 0.50

Tested by

no test coverage detected