![](https://secure.gravatar.com/avatar/3dd475b8aaa5292d74cb0c3f76c3f196.jpg?s=120&d=mm&r=g)
On Mon, Apr 11, 2016, at 10:43, Nikolaus Rath wrote:
To me this sounds like catering to a hypothetical audience that may want to do hypothetical things. If you start with the above, and people complain that their favorite non-pathlib path library is not supported by the stdlib, you can still add a protocol. But if you add a protocol right away, you're stuck with the complexity for a very long time even if almost no one actually uses it.
And there's nothing stopping people from subclassing from Path (should it be PurePath?), or monkey-patching pathlib. In this case, "isinstance(foo, Path) returns true" is the protocol. Also, where is the .path attribute? It's documented <https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.path>, but...
pathlib.Path(".").path Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'PosixPath' object has no attribute 'path'