Guido sees the light: PEP 8 updated

Rustom Mody rustompmody at gmail.com
Tue Apr 19 07:37:25 EDT 2016


On Tuesday, April 19, 2016 at 1:47:48 PM UTC+5:30, Chris Angelico wrote:
> On Tue, Apr 19, 2016 at 6:09 PM, Marko Rauhamaa  wrote:
> > Now, descending back on earth, I don't believe the advantages of rich
> > source code will outweigh those of plain text in the foreseeable future.
> 
> No, they will not, because they'll make your code proprietary.

Pragmatically yes; theoretically no because its like saying
"If one dont want to get locked down to MSWord proprietary tools and formats
one should use latex"
Refuted by the fact that libreoffice and odf etc are free/open


> Suddenly *nothing* else will viably work with your code. (And before
> you say "but diff tools are fine with XML/JSON/YAML/whatever", it's
> not that simple; as soon as the underlying structure is capable of
> representing information that doesn't matter to your source code, you
> open yourself up to diff noise. 

You just nicely described how diff is ½-assed. 
In more detail
here is foo.txt foo1.txt and foo2.txt containing
-------
Now is the time
for all good men
to come to the aid of their country
-------
vi, emacs, shell (cat) show them right and having the same contents
However diff (and therefore unfortunately git) have no clue that one has
DOS line-endings and one is UTF-16

> I've had this exact problem with
> git-managing my OBS configs, which are JSON files; there's one
> particular array that's effectively a set, and the file keeps
> reordering itself. I had to write a pre-commit script that sorts them
> into a consistent order, else I'd have had useless diffs.)

If you are ok with json morphing to yaml you may find ruamel useful
http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts
https://pypi.python.org/pypi/ruamel.yaml



More information about the Python-list mailing list