[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Paul Moore
On Tue, 8 Nov 2022 at 23:34, Steven D'Aprano wrote: > > Most Python coders are using Windows. Surely it is time to do better > for them than "just roll your own"? While I frequently advocate on the side of "not every 3-line function needs to be in the stdlib", there are a lot of convenience fun

[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Steven D'Aprano
On Tue, Nov 08, 2022 at 09:55:04PM +, Barry wrote: > But anyone that is suitably motivated can implement this. This is true for every function in a Turing Complete language. Perhaps we should start using iota or jot? :-) https://en.wikipedia.org/wiki/Iota_and_Jot A "suitably motivated" per

[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Barry
On 8 Nov 2022, at 17:56, Charles Machalow wrote:I would argue that just because it was easy for one to implement doesn't mean it's easy for others. That is true of so many things in life!I would have had no idea how to implement this without extra Googling and confusion.Having the abstraction mak

[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Charles Machalow
I would argue that just because it was easy for one to implement doesn't mean it's easy for others. I would have had no idea how to implement this without extra Googling and confusion. Having the abstraction makes it easier for others. - Charlie Scott Machalow On Tue, Nov 8, 2022 at 1:12 AM Eryk

[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Eryk Sun
On 11/8/22, Charles Machalow wrote: > > 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. As does Python already in many cases. For example, os.lstat() doesn't traverse a mount point (junction). On Wind

[Python-ideas] Re: Add mechanism to check if a path is a junction (for Windows)

2022-11-08 Thread Steven D'Aprano
On Mon, Nov 07, 2022 at 07:31:36PM -, Charles Machalow wrote: > I propose adding a mechanism to both pathlib.Path and os.path to check > if a given path is a junction or not. Currently is_symlink/islink > return False for junctions. +1 on a function is_junction. I am neutral on the questio