pychecker checks files by executing them ??

Jack Diederich jack at performancedrivers.com
Tue Jun 3 17:48:08 CEST 2003


On Tue, Jun 03, 2003 at 10:17:27AM -0500, Skip Montanaro wrote:
> 
> As a pleasant side effect of this slight restructuring, your program might
> run faster.  Why that's so is left as an exercise for the reader. :-)
>

Ack-Thpt! IMO python's biggest wart is that locals are faster than globals.
Not that I would recomend slowing down locals to 'remove' the wart *wink*.
I cringe a bit every time I see the valid, but cargo-cultish

  si_local = StopIteration
  while (bigloop):
    try:  
      # do stuff
    except si_local:
      # other stuff

The only not crappy way to write the offending line is:
  si_local = StopIteration # proven speed hack for version 1.32 of this file on python 2.2.3, please remove and benchmark if running a newer version of either

or usually a shorter comment that means the same thing according to your local
style conventions.

-jack





More information about the Python-list mailing list