MCPcopy Create free account
hub / github.com/cdgriffith/Box / bounded_append

Method bounded_append

test/test_box_list.py:77–81  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

75 remaining = len(data)
76
77 def bounded_append(item):
78 nonlocal remaining
79 assert remaining > 0, "extend revisited an appended element"
80 remaining -= 1
81 append(item)
82
83 # Bound the regression test even if extend iterates its growing destination.
84 monkeypatch.setattr(data, "append", bounded_append)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected