[Python-Dev] Python 3.0 blocks?

François Pinard pinard at iro.umontreal.ca
Sun Aug 28 14:21:05 CEST 2005

[Guido van Rossum]
> [Aahz]

> > IIRC, one of your proposals for Python 3.0 was that single-line
> > blocks would be banned.  Is my memory wrong?

> It's a proposal. I'm on the fence about it.

A difficult decision indeed.  Most single line blocks I've seen would be
more legible if they were written with two lines each, so I'm carefully
avoiding them as a personal rule.

But each rule has exceptions.  There are a few rare cases, usually
sequences of repetitive code, where single line blocks well succeed in
stressing both the repetitive structure and the differences, making the
code more legible then.

As someone well put it already, this is all about Python helping good
coders at writing good code, against Python preventing bad coders from
writing bad code.  Sadly enough, looking around, it seems Python could
be a bit more aggressive against bad practices in this particular case,
even if this might hurt good coders once in a while.  But I'm not sure!

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

More information about the Python-Dev mailing list