Eli Bendersky added the comment: > > > Antoine Pitrou added the comment: > > > Another question: What is the real purpose of pure paths? One thing I > > see is using them to, say, manipulate Windows paths on a Posix machine > > for some reason. > > Yes. Also, if some reason you want to be sure you're only doing path > computations, not I/O. >
"Sure" in what sense, like accidentally? IIUC path manipulation/computation operations don't really call into the OS - only some methods do. > > Any others? Could this also be achieved with just having Paths? > > I don't see how having just Paths would achieve this, unless you think > it's sane to pretend to walk a Windows directory under Unix :-) > I mean, having Path, WindowsPath and PosixPath without the pure counterparts. You usually use Path, but say you want to manipulate Windows paths on a Linux box. So you instantiate a WindowsPath explicitly and do your thing on it. You can't (NotImplementedError) call any methods that would call into the OS, and that's it. I'm just trying to look at the module from the POV of someone who sees it for the first time, wondering "why do I have two kinds of things here, and when would I want to use each? could I just use Path 99.9% of the time and forget about the other options?". If that's true, we may want to reflect it in the documentation explicitly - I believe this will make the module easier to understand. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19673> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com