[Python-ideas] Re: Option Read/Write Files without discarding comments

2020-08-28 Thread Steven D'Aprano
On Fri, Aug 28, 2020 at 09:34:43AM -0700, Christopher Barker wrote: > And on the Python side, there is no standard way to represent arbitrary > text files as Python objects. Um, sure there is: unstructured text, which is exactly what Python does. And contrary to Steve Barnes' comments, Python d

[Python-ideas] Re: Option Read/Write Files without discarding comments

2020-08-28 Thread Christopher Barker
On Fri, Aug 28, 2020 at 5:45 AM Shahriar Heidrich < smheidr...@weltenfunktion.de> wrote: > On 8/28/20 6:56 AM, Steve Barnes wrote: > > This is just about the first part of your mail: There are external > libraries for reading and writing various formats while preserving comments > (and even more,

[Python-ideas] Re: Option Read/Write Files without discarding comments

2020-08-28 Thread Shahriar Heidrich
On 8/28/20 6:56 AM, Steve Barnes wrote: > > It occurs to me that there are many situations where files are human > authored and can include comments but by default when python > reads/modifies/writes those files by default the comments are lost. > >   > > Some examples include configfile, json and