ok am i losing my mind, or is this behavior just absurdly retarded?
(yes, i appreciate the irony of my printf debugging considering the above discussion, but i'm trying to demonstrate a point.)
list = [1, 'a', 'b', 'c', 4]
for item in list:
print "list before: %s" % list
item = int(item)
print "%s cannot be cast to int. Delete it." % item
print "%s looks like an int. No problem, mon." % item
print "list after : %s" % list
print "### final list is %s" % list
seems straightforward to me. however...
is there some simple workaround to this problem? do i need to make a separate clone of list for purposes of iterating? ugh, python.