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

Markus Meskanen markusmeskanen at gmail.com
Mon Mar 27 10:08:58 EDT 2017


-1, should we also include write_ini, write_yaml, etc?

A class cannot account for everyone who wants to use it in different ways.

On Mar 27, 2017 17:07, "Steve Dower" <steve.dower at python.org> wrote:

> It was enough of a benefit for text (and I never forget the argument order
> for writing text to a file, unlike json.dump(file_or_data?, data_or_file?) )
>
> +1
>
> Top-posted from my Windows Phone
> ------------------------------
> From: Paul Moore <p.f.moore at gmail.com>
> Sent: ‎3/‎27/‎2017 5:57
> To: Ram Rachum <ram at rachum.com>
> Cc: python-ideas <python-ideas at python.org>
> Subject: Re: [Python-ideas] Add pathlib.Path.write_json
> andpathlib.Path.read_json
>
> On 27 March 2017 at 13:50, Ram Rachum <ram at rachum.com> wrote:
> > This would make writing / reading JSON to a file a one liner instead of a
> > two-line with clause.
>
> That hardly seems like a significant benefit...
>
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170327/4a573df6/attachment-0001.html>


More information about the Python-ideas mailing list