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

Serhiy Storchaka report at bugs.python.org
Tue Jan 21 12:06:32 CET 2014


Serhiy Storchaka added the comment:

> Christopher and Serhiy, I would appreciate if you could kindly explain why your arguments, while applying to my suggestions, do not apply to the following functions:

1. Path.stat() wraps only one function, while Path.read() wraps two functions. It's signature should be a sum of open() and read() signatures: Path.read(encoding, errors, newline, size) (I have omitted some open's parameters). This is a little cumbersome.

2. os.stat() requires `import os`, while open() is builtin.

3. If add Path.read(), what about Path.readlines() and Path.readline()?

4. I believe Path.stat() will be used much more often than Path.read().

5. Path.stat() corresponds to low-level os.stat(), but for low-level os.read() the high-level corresponding is FileIO.read(). And this corresponding is much more universal and useful.

----------

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


More information about the Python-bugs-list mailing list