News for hackers. Stuff that matters.
Re:Generalizing Support for Functional OOP in R by barfbagginus on Tuesday May 28, 2024 @10:34PM (#40507824)
Pathlib gives a decent oop interface to most file operations. The pathlib docs has a handy Rosetta Stone table for replacing `os` and `shutil` invocations which is very handy.

It could still be better, and sadly being in the stdlib means it probably won't be improved.

For example, we still need shutil.rmtree to recursively nuke a directory. The pathlib way of doing it is laborious and error prone: https://stackoverflow.com/questions/13118029/deleting-folder...

Re:Generalizing Support for Functional OOP in R by orhmeh09 on Wednesday May 29, 2024 @02:38AM (#40509146)
Pathlib is a great addition and it's nice that it's in the standard library. I like fsspec also, which has some functionality that overlaps with Python's existing libraries but makes it a little cleaner IMO.