MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_array

Function test_array

tests/test_stl.py:41–55  ·  view source on GitHub ↗

std::array <-> list

(doc)

Source from the content-addressed store, hash-verified

39
40
41def test_array(doc):
42 """std::array <-> list"""
43 lst = m.cast_array()
44 assert lst == [1, 2]
45 assert m.load_array(lst)
46 assert m.load_array(tuple(lst))
47
48 assert (
49 doc(m.cast_array)
50 == 'cast_array() -> typing.Annotated[list[int], "FixedSize(2)"]'
51 )
52 assert (
53 doc(m.load_array)
54 == 'load_array(arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], "FixedSize(2)"]) -> bool'
55 )
56
57
58def test_array_no_default_ctor():

Callers

nothing calls this directly

Calls 2

tupleClass · 0.85
docFunction · 0.70

Tested by

no test coverage detected