Suggestion for a "data" object syntax

Mikhail V mikhailwas at gmail.com
Sat May 12 10:07:17 EDT 2018


On Sat, May 12, 2018 at 7:54 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sat, 12 May 2018 02:26:05 +0300, Mikhail V wrote:
>
>> it is just  not a trivial task to find an optimal solution to this
>
> We already have an optimal solution to this.

Yes. current syntax will not go anyway so proposal
addresses cases where it is appropriate and
clearly better.

>
> * It works with any editor, including simple ones.

Ok

> * It is safe for transmit over email, or on web forums,
>   so long as you avoid tabs and use spaces.

I don't use spaces so I'm out of luck already.

> * It is readable by humans without them needing to distinguish
>   between two different kinds of invisible space.

I'm using tabs from childhood and don't find it a problem.

> * It can be easily parsed by hand or by machine.

Parsed by hand?

> * It works with a multitude of text processing tools whether
>   or not they can cope with tabs.

Ok. But this is bullet #1, see above, you repeat it

>
> * It is resistant to many sorts of typos.

Here I think you oversimplify - In fact current syntax
introduces typing problems in many cases:
as a user with very high proficiency in typing and
good sight, I have some trouble inputting nested bracketed
arrays  and spend some time trying to match
corresponding suites. Plus the comma noise here,
so your statement is too one-sided and overestimated.

As said, I remember this and similar issues were raised on 'ideas'
so don't pretend it does not exist.

>
> * It allows great flexibility in the presentation, you aren't
>   forced to lay things out in one specific 2D format.

Only words - but nothing concrete

> * It uses the same consistent rules for the rest of the language,
>   without adding special cases and complexity.

I'll grant you for "special cases", but the rest is quite contradictive.
As said, Python uses indented blocks - not bracketed
blocks as in C.
Python does not make semicolons mandatory.
All this is a great improvement, but it seems you
don't see the parallel here.


> * It is a tried-and-true solution that has been used (with minor
>   modifications) for dozens, possibly hundreds, of programming
>   languages, natural language lists and data formats.

> "natural language lists and data formats"

OTOH all _real_ data list, tables, matrices do not include redundant commas,
unless it is really needed.
Any book, lectures, etc. presents them without commas so its
second nature to any human to see it without commas
and its just better so.



M



More information about the Python-list mailing list