MCPcopy Index your code
hub / github.com/python/cpython / __setitem__

Method __setitem__

Lib/test/test_ordered_dict.py:1074–1079  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

1072 return value
1073
1074 def __setitem__(self, key, value):
1075 self.counts['set'] += 1
1076 while key not in self and len(self) >= self.size:
1077 self.popitem(last=False)
1078 super().__setitem__(key, value)
1079 self.move_to_end(key)
1080
1081 def __delitem__(self, key):
1082 self.counts['del'] += 1

Callers 1

test_dict_setitemMethod · 0.45

Calls 3

superClass · 0.85
move_to_endMethod · 0.80
popitemMethod · 0.45

Tested by

no test coverage detected