[issue38924] pathlib paths .normalize()

Brett Cannon report at bugs.python.org
Fri Nov 29 13:47:22 EST 2019


Brett Cannon <brett at python.org> added the comment:

> From my experience in the past the intention has been to keep the API minimal

Correct, all of os.path and shutils does not need to end up in pathlib. :) Hence why the request to add things is always tough as we have to try and strike a balance of useful but not overwhelming/overdone (and what is "useful" varies from person to person).

> It is nice that normpath _accepts_ pathlike objects, but it should then not return a generic str. It should try to return an object of the same type.

It's an interesting idea, but it's also difficult to get right, even with assumptions as things that represent a path are nowhere near as unified as dates. There would also be a ton of converting back and forth in os.path as functions call other functions to get the path, manipulate it, and then wrap it back up.

But if someone can come up with a concrete proposal with some example implementation and brings it to python-ideas it could be discussed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38924>
_______________________________________


More information about the Python-bugs-list mailing list