A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Feb 29 01:18:54 CET 2012


On Wed, 29 Feb 2012 10:24:18 +1100, Chris Angelico wrote:

> Every syntactic structure should
> have the addition of a "foo:" suite, which will run when the programmer
> expects it to and no other time. This would solve a LOT of problems.

    Indeed, when I design my killer language, the identifiers "foo" 
    and "bar" will be reserved words, never used, and not even 
    mentioned in the reference manual. Any program using one will 
    simply dump core without comment. Multitudes will rejoice. 
    -- Tim Peters, 29 Apr 1998



-- 
Steven



More information about the Python-list mailing list