Pathlib support would make Python-wrapped VTK a bit more modern. Personally, I’m not fond of pathlib, because it brings in a little convenience, but also make things a little opaque and causes friction with libraries that do not support it. However, pathlib seems to have a growing user base that is increasingly demanding support for it everywhere (and I admit that if path objects were universally used in all Python libraries then it would be better than using strings). Since VTK is an actively maintained and widely used library, it will have to implement path object support at some point.
I assume that it could be implemented similarly to other wrapper hints. For example this is an existing hint:
double* GetTuple4(vtkIdType tupleIdx)
VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
VTK_SIZEHINT(4);
and this could be a new hint that would tell the VTK wrapper to add in some extra code to allow conversion to/from pathlike object:
void SetFileName(const char* fname) VTK_EXPECTS_PATHLIKE(fname);
const char* GetFileName() VTK_PATHLIKE();
@fepegar When these libraries return a path, do they return it as a string or path object? If they return path object, how did they do the transition from using string (wasn’t it a breaking change)?