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

Ram Rachum ram at rachum.com
Mon Mar 27 08:51:17 EDT 2017


Oh, and also it saves you from having to import json.

On Mon, Mar 27, 2017 at 2:50 PM, Ram Rachum <ram at rachum.com> wrote:

> Hi guys,
>
> 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?
>
> This would make writing / reading JSON to a file a one liner instead of a
> two-line with clause.
>
>
> Thanks,
> Ram.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170327/a6553628/attachment.html>


More information about the Python-ideas mailing list