Pathlib: preserve trailing slash

Well, if that becomes a design goal for pathlib, then it means you’re turning pathlib into something else. From “a library to handle filesystem paths” to “an object-oriented replacement for os and shutil”.

This complicates the conceptual model quite a bit for very little added value.

I’ll stress that the trailing slash thing is only a (mis)feature of POSIX APIs. It doesn’t have anything to do with filesystem paths per se. /etc and /etc/ are not different objects.

8 Likes