Add support for PEP 519 (file system path protocol)
Gemmi currently cannot deal with python path protocol objects (PEP 519, PEP 428):
$ python -c "import gemmi,pathlib; gemmi.cif.read_file(pathlib.Path('z'))"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: read_file(): incompatible function arguments. The following argument types are supported:
1. (filename: str) -> gemmi.cif.Document
Invoked with: PosixPath('z')
(Presumably this is the relevant section in the PEP)
I googled how it works in combination with pybind11, but I haven't found anything. So I think I'll wait until the path protocol is supported in pybind11, or until I come across a recipe how to handle path protocol objects.
Is it that what you are searching for? https://github.com/pybind/pybind11/pull/2730/commits/53da968ee6774a11273955cfb1821c91b72d35fe It is in version 2.7.0
yes, actually I've seen it recently, but I left it for later. It can be used as an example how to support the path protocol.