[Python-ideas] Syntax idea for 2D lists\arrays

Mikhail V mikhailwas at gmail.com
Sat Mar 17 21:04:43 EDT 2018


On Thu, Mar 15, 2018 at 6:15 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Thu, Mar 15, 2018 at 01:32:35AM +0100, Mikhail V wrote:
>

>
> Using spaces to separate items has the fatal flaw that it cannot
> distinguish
>
>     x - y 0  # two items, the expression `x - y` and the integer 0
>
> from:
>
>    x - y 0  # three items, `x`, `-y`, and 0
>
>

Ah, sorry, my bad.
Now I remember preciser what was my formatting idea originally.
That would make things clearer indeed - the separator would be TAB
character only. (I wrote tabs or spaces in proposal).
The root of the idea was finding a cleaner way for defining tables and
data plus some experiments with nesting syntax, etc.
Back then I did not think much about supportin expressions
inside elements, so this important issue slipped through.

So with the TAB separator, just think of replacement TAB->comma,
this should support all Python expressions automatically.
At least seems to me so, but if I am delusional - please correct me.

Of course the reality is still, that sadly, most editors cannot handle tabulaton
adequately. But I am a believer and hope for better future.
(Heck, people building space ships and what not, so maybe tabulation
in code editors comes next?)


More information about the Python-ideas mailing list