I have stepped on small piece of code that made me wandering:
Style1 (assumed textbook example):
mylist = ['a','b','c']
for item in mylist:
do_someting_with(item)
and Style2 (code seen around):
mylist = ['a','b','c']
for item in mylist[:]:
do_someting_with(item)
Both styles render to the same result (in theory and practice) but there could be some subtle difference in execution. Is there a reason for style2 or that is simply a bad code that could be more clear?