+1 on adding Path.is_junction() that returns False on non-Windows systems. (I'm a Windows user and I use junctions as well.)
On Tue, Nov 8, 2022 at 9:24 AM Charles Machalow <csm10...@gmail.com> wrote: > I'm not technical enough here to try to argue which it is closer to. We > can say it's like so and so in implementation, but I just liken it a > certain way. > > I think for regular users it makes most sense to just have a specific > function rather than expecting folks to know concept similarities... a > simple function that does one thing well is best... But that's just my > opinion. > > Funny enough in PowerShell, for prints an "l" for both symlinks and > junctions.. so it kind of thinks of it as a link of some sort too I guess. > > Is it that much of a waste to just return False on posix? I mean it's a > couple lines and just maintains api.. and in theory can be more clear to > some. > > An alternative is to make it just available on Windows... But I'd > personally prefer a function that returns False on other than Windows to > maintain api. The docs can even say that it can only return False on > non-Windows. > > > On Mon, Nov 7, 2022, 11:05 PM Eryk Sun <eryk...@gmail.com> wrote: > >> On 11/8/22, Charles Machalow <csm10...@gmail.com> wrote: >> > I tend to prefer adding isjunction instead of changing ismount since I >> tend >> > to not think about junctions as being mounts (but closer to symlinks).. >> >> Junctions are mount points that are similar to Unix bind mounts where >> it counts -- in the behavior that's implemented for them in the >> kernel. This behavior isn't exclusive to just volume mount points. >> It's implemented the same for all junctions, and it's distinctly >> different from symlinks. >> >> There are times that I want to handle non-root mount points as if >> they're symlinks, such as deleting them in rmtree(). There are times >> where I want to handle them distinctly from symlinks, such as adding >> code in copytree() to copy a junction. >> >> > I guess either way the closeness of the concepts is a different story >> than >> > the specific ask here. In other words: for clarity, adding a specific >> > method makes the most sense to me. >> >> Adding a posixpath.isjunction() function that's always false seems a >> waste compared to common support for os.path.ismount(). On the other >> hand, the realpath() call in posixpath.ismount() is expensive, so >> calling os.path.ismount() to decide how to handle a directory would be >> expensive on POSIX. >> > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/I5TAW23L2PV7P3TAJFA4WVVSCNRAPLNA/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YXDUIFWBLQWO3RMIFDWZ6VBX5CASWOJD/ Code of Conduct: http://python.org/psf/codeofconduct/