You must log in or register to comment.
Path objects also override the / operator to join paths
This is both cool and gross… gives me C++ vibes (operator overloading abuse).
They could have chosen a better operator. But the functionality is fantastic. Makes working with paths so much easier. And you can even use slashes on windows paths.
Nice, mypath.open() is a more semantic alternative to open(my path)
Don’t forget about the helper functions
mypath.read_text()
andmypath.write_text(content)
that’s already in the cheatsheet