Skip to content

Commit

Permalink
Python: Remove Attributable.__len__
Browse files Browse the repository at this point in the history
For consistency because its only a mixin class.
Write migration guide for breaking change.
  • Loading branch information
ax3l committed Sep 5, 2024
1 parent bd25038 commit fea1fda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Note that ADIOS2 does not support compression in BP3 files.

pybind11 2.12.0 is now the minimally supported version for Python support.

The ``len(...)`` of many classes has been reworked for consistency and returns now the number of entries (iterations, record components, etc.).
Previously, this sporadically returned the number of attributes, which is better queried via ``len(<object>.attributes)``.


0.15.0
------
Expand Down
2 changes: 0 additions & 2 deletions src/binding/python/Attributable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,6 @@ void init_Attributable(py::module &m)
.def("delete_attribute", &Attributable::deleteAttribute)
.def("contains_attribute", &Attributable::containsAttribute)

.def("__len__", &Attributable::numAttributes)

// @todo _ipython_key_completions_ if we find a way to add a []
// interface

Expand Down

0 comments on commit fea1fda

Please sign in to comment.