This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, mrdiskodave
Date 2009-09-16.18:22:37
SpamBayes Score 0.0041835713
Marked as misclassified No
Message-id <1253125359.15.0.202381672279.issue6921@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, I see the problem now:  you're expecting that after

for p, elt in enumerate(mylist):
    <do_stuff>

p will be equal to len(mylist)-1.  That's true if mylist is nonempty 
(because on the last round of the for loop, p gets the value len(mylist)-
1), but if mylist is empty then no assignment to p or to elt is ever made.  
That's just the way that Python for loops work, I'm afraid.  :-)
History
Date User Action Args
2009-09-16 18:22:39mark.dickinsonsetrecipients: + mark.dickinson, mrdiskodave
2009-09-16 18:22:39mark.dickinsonsetmessageid: <1253125359.15.0.202381672279.issue6921@psf.upfronthosting.co.za>
2009-09-16 18:22:38mark.dickinsonlinkissue6921 messages
2009-09-16 18:22:37mark.dickinsoncreate