> > What puzzles me most is that I can replace 'seg' with just about > > anything else - > > for seg in tmpSegs: > > seg = seg.strip() > > or > > for seg in tmpSegs: > > seg = 'bananas' > > or > > for seg in tmpSegs: > > seg = seg + ' bananas' > > and it works. So why can't I replace it with its own split? > > If by 'it works' you mean that tmpSegs is changed...you are mistaken or > there is something you are not showing. Can you show why you think this > changes tmpSegs?
I see I have been misled by trying too many things in a short time and confusing my results. I could have sworn that late last night, before I hit on the solution of assigning to a new list altogether, I tried the above examples and followed them with another "for seg in tmpSegs" loop that simply printed the contents. I now suspect myself of being too sleepy (and probably inadvertently assigning to a new list anyway!) at the time, because - as you already know - when I try it now, tmpSegs is unchanged. I hang my head in shame. Thanks for the responses - Marc -- www.fsrtechnologies.com
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor