> On 27 Mar 2017, at 15:08, Markus Meskanen <[email protected]> wrote: > > -1, should we also include write_ini, write_yaml, etc? >
Markus, You illustrate why this is a bad design pattern to implement. It does not scale. I attended a talk at PYCON UK that talked to the point of using object composition rather then rich interfaces. I cannot recall the term that was used to cover this idea. I also think that its a mistake to open a text file from pathlib. -1 A pattern that allows pathlib.Path to be composed with content handling is an interesting idea. Maybe that should be explored? But that should be a separate topic. Barry > A class cannot account for everyone who wants to use it in different ways. > > On Mar 27, 2017 17:07, "Steve Dower" <[email protected] > <mailto:[email protected]>> 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 <mailto:[email protected]> > Sent: 3/27/2017 5:57 > To: Ram Rachum <mailto:[email protected]> > Cc: python-ideas <mailto:[email protected]> > Subject: Re: [Python-ideas] Add pathlib.Path.write_json > andpathlib.Path.read_json > > On 27 March 2017 at 13:50, Ram Rachum <[email protected] > <mailto:[email protected]>> 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 > [email protected] <mailto:[email protected]> > https://mail.python.org/mailman/listinfo/python-ideas > <https://mail.python.org/mailman/listinfo/python-ideas> > Code of Conduct: http://python.org/psf/codeofconduct/ > <http://python.org/psf/codeofconduct/> > > _______________________________________________ > Python-ideas mailing list > [email protected] <mailto:[email protected]> > https://mail.python.org/mailman/listinfo/python-ideas > <https://mail.python.org/mailman/listinfo/python-ideas> > Code of Conduct: http://python.org/psf/codeofconduct/ > <http://python.org/psf/codeofconduct/> > > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
