this is an idea that’s been rattling around my head for a few weeks on and off, and I freely admit I’m putting it here to get it out of my head, rather than seriously thinking this is a good idea.
The idea is to add context to pathlib objects, things like follow_symlink, follow_junction, maybe fold_case and all the other weird filesystem things that I don’t even know about.
p = pathlib.Path("/one/two/three", follow_symlinks=True)
from this point onwards, operations on p will gain the context of follow_symlinks=True, it would not have to be added to higher level operations, and such context could be passed through APIs that take Path objects.
r = p / "four"
would gain the context of follow_symlinks=True, any low level operation that changes based on the context could check it and do so.
The hope is we could stop adding follow_symlink/junction flags everywhere, still have the functionality when required, and make such options opaque to APIs that just want to think about paths.
thank you for your time,