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

Function test_valarray

tests/test_stl.py:65–76  ·  view source on GitHub ↗

std::valarray <-> list

(doc)

Source from the content-addressed store, hash-verified

63
64
65def test_valarray(doc):
66 """std::valarray <-> list"""
67 lst = m.cast_valarray()
68 assert lst == [1, 4, 9]
69 assert m.load_valarray(lst)
70 assert m.load_valarray(tuple(lst))
71
72 assert doc(m.cast_valarray) == "cast_valarray() -> list[int]"
73 assert (
74 doc(m.load_valarray)
75 == "load_valarray(arg0: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> bool"
76 )
77
78
79def test_map(doc):

Callers

nothing calls this directly

Calls 2

tupleClass · 0.85
docFunction · 0.70

Tested by

no test coverage detected