diff --git a/include/openPMD/binding/python/Mpi.hpp b/include/openPMD/binding/python/Mpi.hpp index 5de6077f09..7b61128b7c 100644 --- a/include/openPMD/binding/python/Mpi.hpp +++ b/include/openPMD/binding/python/Mpi.hpp @@ -94,7 +94,7 @@ pythonObjectAsMpiComm(pybind11::object &comm) e_t::is_not_an_mpi_communicator}; // only checks same layout, e.g. an `int` in `PyObject` could pass this if (!py::isinstance >( - comm.get_type())) + py::type::of(comm))) // TODO add mpi4py version from above import check to error message return e{ "comm has unexpected type layout in " + comm_str + diff --git a/src/binding/python/Attributable.cpp b/src/binding/python/Attributable.cpp index 59131704c0..4107616556 100644 --- a/src/binding/python/Attributable.cpp +++ b/src/binding/python/Attributable.cpp @@ -275,7 +275,7 @@ template bool setAttributeFromObject_default( Attributable &attr, std::string const &key, py::object &obj) { - if (std::string(py::str(obj.get_type())) == "") + if (std::string(py::str(py::type::of(obj))) == "") { using ListType = std::vector; return attr.setAttribute(key, obj.cast()); @@ -289,7 +289,7 @@ bool setAttributeFromObject_default( bool setAttributeFromObject_double( Attributable &attr, std::string const &key, py::object &obj) { - if (std::string(py::str(obj.get_type())) == "") + if (std::string(py::str(py::type::of(obj))) == "") { using ListType = std::vector; using ArrayType = std::array; @@ -342,7 +342,7 @@ std::optional tryCast(py::object const &obj) { TargetType val{}; auto python_val = py::cast(std::move(val)); - if (!py::isinstance(obj, python_val.get_type())) + if (!py::isinstance(obj, py::type::of(python_val))) { return std::nullopt; } diff --git a/src/binding/python/Series.cpp b/src/binding/python/Series.cpp index 2c51731f38..8cbee9a3f7 100644 --- a/src/binding/python/Series.cpp +++ b/src/binding/python/Series.cpp @@ -387,7 +387,10 @@ not possible once it has been closed. std::tuple, std::tuple #endif - >::template call(cl); + >::template call &>(cl); + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // need to explicitly state template parameters, otherwise Clang on + // Windows does not understand that it really is a template cl.def("__bool__", &Series::operator bool) .def("__len__", [](Series const &s) { return s.iterations.size(); })