Python syntax wart

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Sep 10 10:14:23 CEST 2007


On Mon, 10 Sep 2007 19:54:49 +1200, Lawrence D'Oliveiro wrote:

> In message <5kk8p0F3vfqqU1 at mid.uni-berlin.de>, Marc 'BlackJack' Rintsch
> wrote:
> 
>> On Mon, 10 Sep 2007 15:02:58 +1200, Lawrence D'Oliveiro wrote:
>> 
>>> In message <5ki2sdF3nr68U1 at mid.individual.net>, Bjoern Schliessmann
>>> wrote:
>>> 
>>>> Lawrence D'Oliveiro wrote:
>>>>> But then you can no longer use indentation to display the
>>>>> two-dimensional structure of the statement.
>>>> 
>>>> How can a statement be two-dimensional?
>>> 
>>> Like this (from C++ code, but the idea is the same):
>>> 
>>>     if
>>>       (
>>>             ThisCh >= 'A' and ThisCh <= 'Z'
>>>         or
>>>             ThisCh >= '0' and ThisCh <= '9'
>>>         or
>>>             ThisCh == '_'
>>>         or
>>>             ThisCh == '.'
>>>       )
>>>         ...
>> 
>> I still down see the second dimension.
> 
> Horizontal + vertical = 2 dimensions.

Wow I wrote two dimensional programs all the time without knowing it.

> A more complicated example:
> 
>     if
>       (
>             TheProduct == JobSettings.Product.end()
>         or
>                 TheProduct->second.PerType != ProductPerPerson
>             and
>                 TheProduct->second.PerType != ProductPerNone
>       )
>         ...

Sorry I still don't understand how this could be called a 2D statement. 
Or is this already 3D!?  I see a tree structure here, but still no table. 
And this is also easily written that way in Python if you don't insist on
the line break after the ``if`` or can live with backslashes.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list