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

Function gen_items

Lib/test/test_buffer.py:200–207  ·  view source on GitHub ↗

Return a list of random items (or a scalar).

(n, fmt, obj)

Source from the content-addressed store, hash-verified

198 return x[0] if len(x) == 1 else tuple(x)
199
200def gen_items(n, fmt, obj):
201 """Return a list of random items (or a scalar)."""
202 if n == 0:
203 return gen_item(fmt, obj)
204 lst = [0] * n
205 for i in range(n):
206 lst[i] = gen_item(fmt, obj)
207 return lst
208
209def struct_items(n, obj):
210 mode = choice(cap[obj][MODE])

Callers 3

struct_itemsFunction · 0.85
randitemsFunction · 0.85
randitems_from_structureFunction · 0.85

Calls 1

gen_itemFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…