> On Mar 27, 2017, at 10:36 AM, Paul Moore <p.f.mo...@gmail.com> wrote: > > On 27 March 2017 at 15:33, Donald Stufft <don...@stufft.io > <mailto:don...@stufft.io>> 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? >> >> >> >> -1, I also think that write_* and read_* were mistakes to begin with. > > Text is (much) more general-use than JSON.
Sure. I also think touch() and all the others are the same :) I think they’re just an unfortunate detritus of a time before PathLike and that it’s super weird to have some operations you do to a file path (compared to things you do to generate, modify, or resolve a path) be hung off of the Path object and every other be an independent thing that takes it as an input. I’d find it equally weird if dictionary objects supported a print() or a .json() method. — Donald Stufft
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/