alternatives to making blocks like { } or other ??

Paul McGuire ptmcg at austin.rr._bogus_.com
Tue May 18 17:06:24 EDT 2004


"Larry Bates" <lbates at swamisoft.com> wrote in message
news:FJCdnVqIN7iG8TfdRVn-vg at comcast.com...
> Blocks in Python are defined not with {} but rather
> with indention.  You indent to start a block and
> stop indenting when you wish to end it.  Seems odd
> at first, but turns out to be excellent way to
> handle blocks (and to properly format you code).
>
> HTH, Larry Bates
>
> "CYBER" <usenet at zly_adres.com> wrote in message
> news:c8do0u$9fb$1 at news.atman.pl...
> > Hello
> >
> > Is there any other way under python to create blocks ??
> >
> > instead of
> >
> > def sth(x):
> > return x
> >
> >
> >
> > could i use something else like
> >
> > def sth(x):
> > {
> > return x
> > }
> >
> >
> > ???
>
>
... and no religious wars on where the braces are supposed to go, HOORAY!!!

And I'll second Larry's comment - it takes about 10-20 minutes to get used
to, but then you just focus on indentation, and it seems *very* natural -
liberating, even!

-- Paul





More information about the Python-list mailing list