Question about indentation and bugs

Terry Reedy tjreedy at home.com
Fri Aug 24 23:48:57 EDT 2001


"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.998693619.27471.python-list at python.org...
> [Terry Reedy]
> > *NOT* using {} redundantly for blocking frees {} for use as
dictionary
> > delimiters.  Anyone who suggests using {} for structure should be
> > asked how they would write dictionary literals!
>
> Easy!  Instead of, e.g.,
>
>     if 1:
>         x = {1: 'a', 2: {'b': 3}}
>         print x
>
> we'll rehabilitate indentation for dict literals:
>
>     if 1 {
>  x =
>      1: 'a'
>      2:
>          'b': 3
>   print x
>  }
>
> IOW, the body of a dict literal needs to be indented relative to the
> preceding stmt, and the stmt following a dict literal needs to be
dedented.
> Apart from those rules, you can enjoy the readability afforded by
curly
> braces to start stmts wherever the hell you feel like, damn it
<wink>.

Delightfully funny.  You example reminded me of a different use for
variable indentaton: outlines, such as I did in school.  (Yes, some
styles uses letters and numbers to redundantly indicate depth, but not
all do.)  I wonder if the people who do not like semantic indents
might be people who did not like doing outlines in school.

Terry J. Reedy






More information about the Python-list mailing list