Support for pathlib

Since the SetFileName() methods are used so much more often than the GetFileName(), I think it’s reasonable to take a pragmatic approach and only modify SetFileName(). Basically the idea is just to make VTK a little more convenient to use.

In any case, the wrappers are not going to import pathlib at the very low level of individual class wrapping. That would be an invasive change, and there’s no precedent for it. On the other hand, it’s straightforward to make SetFileName() look for an __fspath__ attribute, either with manual or automatic hinting.

2 Likes