Add mechanism to check if a path is a junction

Cross-posting a thread from the python-ideas mailing list: Mailman 3 Add mechanism to check if a path is a junction (for Windows) - Python-ideas - python.org

The gist is, I’m proposing we add a isjunction method to os.path and a is_junction method to pathlib.Path. Both would return True if the given path is a junction. On Posix the API would exist, but would always return False as this tends to be a Windows-only thing.

I understand that a function could be written to do this, but at the same time, it fits into a similar vein as is_symlink, etc. I understand, users could check stat and flags, but instead having easy to use methods are really helpful to end users.

3 Likes