[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

Ram Rachum report at bugs.python.org
Tue Jan 21 12:21:26 CET 2014


Ram Rachum added the comment:

Serhiy:

Your arguments 1 and 2 are pretty weak. (So what if an import is required? It's still 2 lines. I thought that "Not every two line function are worth to be added to the stdlib.")

Regarding stat being used much more often than read: I disagree. I've done whole-file reads much more often than I've done stat. Different people might have different habits, but I definitely think that reading an entire file is a common operation with files. And we can all agree that other trivial Path method like `lstat` are much less common than both stat and whole-file read, yet they've earned their place in the stdlib, while we are still arguing whether `Path.read` and `path.write` should have a place too.

Regarding `Path.readline` and `Path.readlines`: I don't have an opinion on whether they should be implemented or not, since I rarely use them. But I definitely think that they have no bearing on the decision of whether to include `Path.read` and `Path.write` or not.

Your argument 5 also looks weak to me. It looks to me like you're looking for arguments.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20218>
_______________________________________


More information about the Python-bugs-list mailing list