MCPcopy
hub / github.com/praw-dev/praw / add

Method add

praw/models/util.py:35–40  ·  view source on GitHub ↗

Add an item to the set discarding the oldest item if necessary.

(self, item: Any)

Source from the content-addressed store, hash-verified

33 self._set.move_to_end(item)
34
35 def add(self, item: Any) -> None:
36 """Add an item to the set discarding the oldest item if necessary."""
37 self._access(item)
38 self._set[item] = None
39 if len(self._set) > self.max_items:
40 self._set.popitem(last=False)
41
42
43class ExponentialCounter:

Callers 15

stream_generatorFunction · 0.95
test_boundMethod · 0.95
test_containsMethod · 0.95
test_lru_addMethod · 0.95
test_lru_containsMethod · 0.95
discover_subclassesMethod · 0.45
cassetteMethod · 0.45
test_pin__removeMethod · 0.45
test_addMethod · 0.45
test_add__bytesMethod · 0.45
test_add_with_permsMethod · 0.45
test_addMethod · 0.45

Calls 1

_accessMethod · 0.95

Tested by 15

test_boundMethod · 0.76
test_containsMethod · 0.76
test_lru_addMethod · 0.76
test_lru_containsMethod · 0.76
test_pin__removeMethod · 0.36
test_addMethod · 0.36
test_add__bytesMethod · 0.36
test_add_with_permsMethod · 0.36
test_addMethod · 0.36
test_addMethod · 0.36
test_addMethod · 0.36
test_add__non_specialMethod · 0.36