Hm. I personally consider a trailing slash significant. It feels semantically different (and in some cases it is) so I don't think it should be normalized. The behavior of os.path.split() here feels right.


On Wed, Aug 6, 2014 at 7:30 PM, Antoine Pitrou <antoine@python.org> wrote:

Le 06/08/2014 22:12, Ben Finney a écrit :

You seem to be saying that ‘pathlib’ is not intended to be helpful for
constructing a shell command.

pathlib lets you do operations on paths. It also gives you a string representation of the path that's expected to designate that path when talking to operating system APIs. It doesn't give you the possibility to store other semantic variations ("whether a new directory level must be created"); that's up to you to add those.

(similarly, it doesn't have separate classes to represent "a file", "a directory", "a non-existing file", etc.)

Regards

Antoine.



--
--Guido van Rossum (python.org/~guido)