◐ Shell
clean mode source ↗

Message 229550 - Python tracker

Well, if you use an isinstance check you privilege the stdlib Path over any other pathlike implementation.  Since it *is* in the stdlib, this isn't an automatic reason for rejection, but it does have a bit of a code smell to it.  Why should everything that deals with path strings have to have intimate knowledge of Path objects?

I originally wrote here "Maybe we need a __path__ magic method" as a half-joke, but rereading the issue I see that this has in fact been proposed seriously, and referenced by Antoine (the pathlib author).

I'm -1 on just sprinkling support for Path throughout the stdlib.  Do it in a universally applicable fashion or don't do it at all, IMO.