Closed rgaudin closed 4 years ago
Yes we should.
pathlib
is good. I personally tend to prefer manipulate all the time Path
when we are manipulate path.
I would said that we should take Path
by "default" and convert str to path if needed. (And so return a Path
for the getfilename function). And convert to str
/bytes
when passing the value to the cpp world.
With the general move in the stdlib to accept
pathlib.Path
for all path-related operations, it seems a little odd and dated to have to to sendstr
to the libzim.I'd like to harmonize with this move so that the
Creator
andFile
can take bothstr
andPath
and we'd check the type in the python wrapper and converts it tostr
for the binding.I shall mention that functions usually returns same type as provided. We only output path for
File.filename
I think. We would acknowledge that we'd still returnstr
here (otherwise we'd have to store the type info in the wrapper)