mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Add a pybind function to clear a list. (#5153)
* Add a pybing function to clear a list. * Add required error handling. * Add `/* py-non-const */` as suggested by @Skylion007 --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
This commit is contained in:
@@ -65,6 +65,8 @@ def test_list(capture, doc):
|
||||
assert lins == [1, 83, 2]
|
||||
m.list_insert_size_t(lins)
|
||||
assert lins == [1, 83, 2, 57]
|
||||
m.list_clear(lins)
|
||||
assert lins == []
|
||||
|
||||
with capture:
|
||||
lst = m.get_list()
|
||||
|
||||
Reference in New Issue
Block a user