Regarding the pathlib module in the standard library, is the Path.open() method is just a "wrapper" for built-in open() function?
If you read the source code of pathlib.Path.open you'll find that it simply does:
return io.open(str(self), mode, buffering, encoding, errors, newline, opener=self._opener)
and according to io's documentation:
io.open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)This is an alias for the builtin
open()function.
So you are correct that pathlib.Path.open is just a wrapper for the built-in open function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With