A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
Chris Angelico
rosuav at gmail.com
Tue Feb 28 18:24:18 EST 2012
More information about the Python-list mailing list
Tue Feb 28 18:24:18 EST 2012
- Previous message (by thread): A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
- Next message (by thread): A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Feb 29, 2012 at 9:56 AM, Rick Johnson <rantingrickjohnson at gmail.com> wrote: > On Feb 24, 8:54 am, Steven D'Aprano <steve > +comp.lang.pyt... at pearwood.info> wrote: > >> In Python 4000, I think for loops should be spelled: >> >> for name in iterable: >> # for block >> then: >> # only if not exited with break >> else: >> # only if iterable is empty >> >> and likewise for while loops. > > I like this syntax better than the current syntax, however, it is > STILL far too confusing! Absolutely, it's FAR too confusing. 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. ChrisA
- Previous message (by thread): A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
- Next message (by thread): A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list