[Python-ideas] Add pathlib.Path.write_json and pathlib.Path.read_json

Ethan Furman ethan at stoneleaf.us
Mon Mar 27 11:50:06 EDT 2017


On 03/27/2017 08:04 AM, Steven D'Aprano wrote:
> On Mon, Mar 27, 2017 at 02:50:38PM +0200, Ram Rachum wrote:

>> What do you think about adding methods pathlib.Path.write_json and
>> pathlib.Path.read_json , similar to write_text, write_bytes, read_text,
>> read_bytes?
>
> That's not pathlib's responsibility, and there is nothing wrong with
> writing two lines of code.

+1



More information about the Python-ideas mailing list