[Python-Dev] PEP 343 - Abstract Block Redux

Jack Diederich jack at performancedrivers.com
Tue May 17 02:21:12 CEST 2005


On Mon, May 16, 2005 at 06:24:59PM +1200, Greg Ewing wrote:
> Brett C. wrote:
> 
> > Nick's was obviously directly against looping, but, with no offense to Nick,
> > how many other people were against it looping?  It never felt like it was a
> > screaming mass with pitchforks but more of a "I don't love it, but I can deal"
> > crowd.
> 
> My problem with looping was that, with it, the semantics
> of a block statement would be almost, but not quite,
> exactly like those of a for-loop, which seems to be
> flying in the face of TOOWTDI. And if it weren't for
> the can't-finalise-generators-in-a-for-loop backward
> compatibility problem, the difference would be even
> smaller.

Nodders, the looping construct seemed to work out fine as code people
could use to get their heads around the idea.  It was eye-gougingly bad
as final solution.

Forcing people to write an iterator for something that will almost never
loop is as awkward as forcing everyone to write "if" statements as

for dummy in range(1):
  if (somevar):
    do_true_stuff()
    break
else:
  do_false_stuff()

I still haven't gotten used to Guido's heart-attack inducing early 
enthusiasm for strange things followed later by a simple proclamation
I like.  Some day I'll learn that the sound of fingernails on the
chalkboard is frequently followed by candy for the whole class.  
For now the initial stages still give me the shivers.

-jackdied


More information about the Python-Dev mailing list