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

Function test_inherited_protocol

tests/test_buffers.py:140–145  ·  view source on GitHub ↗

SquareMatrix is derived from Matrix and inherits the buffer protocol

()

Source from the content-addressed store, hash-verified

138
139
140def test_inherited_protocol():
141 """SquareMatrix is derived from Matrix and inherits the buffer protocol"""
142
143 matrix = m.SquareMatrix(5)
144 assert memoryview(matrix).shape == (5, 5)
145 assert np.asarray(matrix).shape == (5, 5)
146
147
148def test_pointer_to_member_fn():

Callers

nothing calls this directly

Calls 2

memoryviewClass · 0.85
SquareMatrixMethod · 0.80

Tested by

no test coverage detected