added len support to python files

This commit is contained in:
Erik Fröjdh
2026-06-12 13:32:38 +02:00
parent 4c0cc7a1f2
commit 62630ec013
6 changed files with 9 additions and 1 deletions
+1
View File
@@ -60,6 +60,7 @@ void define_file_io_bindings(py::module &m) {
.def("seek", &File::seek)
.def("tell", &File::tell)
.def_property_readonly("total_frames", &File::total_frames)
.def("__len__", &File::total_frames)
.def_property_readonly("rows", &File::rows)
.def_property_readonly("cols", &File::cols)
.def_property_readonly("bitdepth", &File::bitdepth)