Python 3 (-), Old Man Yells At Cloud
I was appreciating the fact that with Python 3, we finally get a Path type in the standard library.
Until I discovered that `Path('/var/www').joinpath('/etc/passwd')` doesn't throw `InsecurePath`.
Okay, I can imagine there are some use cases where you want to be able to represent `foo/../../assets` or something, but usually not, and resetting the root to `/` never.
which is why t.p.filepath has guarded against that sort of thing since its inception in 2003.
Come on, stdlib, where are my Batteries Included? PEP 428 even cites t.p.filepath as prior art, along with Unipath, which offers a method with similar protections.
I'm checking PEP 428's mailing list discussion, but I don't know how to find this amongst the fucktillion messages debating operator overloading. Maybe that's the answer: everyone who was tired of reading about operator overloading stopped thinking about this PEP.
re: Python 3 (-), Old Man Yells At Cloud
It was also around the same time as a bunch of the async discussion, so to the extent that anyone who worked with t.p.filepath was paying attention to python-ideas, they were probably trying to keep tabs on that discussion more than pathlib.
Kotlin, path manipulation
Speaking of Kotlin, how does Kotlin standard library deal with paths?
`File("/var/www").resolve(File("/etc/passwd"))` ends up with /etc/passwd, but I am much happier with that named "resolve" than "join".
`File(File("/var/www"), "/etc/passwd"))` doesn't error, but gives /var/www/etc/passwd. You can totally construct /var/www/../../etc/passwd that way, though.
That's `File(File, String)` but there is no `File(File, File)`.
And I don't find any other `File.x(File)` where `x` is anything like `child` or `descendant`.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!