[Python-Dev] Chaining try statements: eltry?

François Pinard pinard at iro.umontreal.ca
Thu Jul 7 21:16:34 CEST 2005


[Guido van Rossum]
> On 7/7/05, François Pinard <pinard at iro.umontreal.ca> wrote:
> > [Guido van Rossum]

> > > I even wonder if else-clauses on for/while were a good idea.

> > I surely find them useful, and see them as a Python originality (a
> > welcome one).

> The question remains whether Python would be easier to learn without
> them.

Some of my co-workers, while being very dedicated and efficient to the
production duties, are not especially fond on computer languages, and
have only moderate pleasure learning them.  They are very good people
nevertheless! :-) After PL/I, C, some obscure languages you do not even
know, and now Python, they receive it as just yet another in the series,
and they accept taming themselves, slowly, around Python.  I saw that
the `else:' clause to `for' and `while' has been a surprise to them, and
observe that they usually do not readily recognise cases where it would
be useful.  Yet, others in the gang are more enthusiastic, and they do
not trip at all over various `else:'s.  So, it much depends on the kind
of relation between programmers and languages.

You know, Python would be easier to learn without all `__xyz__' methods,
and without meta-classes :-). [Yet my feeling is that people overdo the
difficulty of meta-classes, which do not deserve the prejudice they
got.]  The learning curve of `else:' is much smoother by comparison.
`else:' _are_ useful in my experience, as I know I used stunts for years
in other languages for achieving about the same effect.  These are for
elementary or basic day-to-day algorithms, and I cannot believe common
problems are so different between a programmer and another.

> All hard to assess impartially!

Granted.  That's why I throw my opinion in this forum.

-- 
François Pinard   http://pinard.progiciels-bpi.ca


More information about the Python-Dev mailing list