Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Bill Allen
That's exactly right! Never heard it called that before, but that is basically what happened. I appreciate the help. --Bill On Tue, Jan 25, 2011 at 06:38, Wayne Werner wrote: > On Tue, Jan 25, 2011 at 1:42 AM, Alan Gauld wrote: > >> >> "Bill Allen" wrote >> >> Thats often the way :-) >>

Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Bill Allen
Steven, Thanks! That is quite helpful to know the nuts and bolts of how that works. --Bill On Tue, Jan 25, 2011 at 07:45, Steven D'Aprano wrote: > Bill Allen wrote: > >> Ok, I have definately verified this to myself. The following works >> perfectly and is a little easier to understand.

Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Steven D'Aprano
Bill Allen wrote: Ok, I have definately verified this to myself. The following works perfectly and is a little easier to understand. In this version, I am plainly modifying my parts_list iterator thus producing the effect of an iterator that is growing over the course of the operation of the c

Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Wayne Werner
On Tue, Jan 25, 2011 at 1:42 AM, Alan Gauld wrote: > > "Bill Allen" wrote > > Thats often the way :-) > The act of articulating the problem forces you to think about it > differently. > Also called "Rubber Duck Debugging" http://en.wikipedia.org/wiki/Rubber_duck_debugging

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread David Hutto
On Tue, Jan 25, 2011 at 2:42 AM, Alan Gauld wrote: > > "Bill Allen" wrote > >> I am convinced that I had previously assigned part_list to out_list by >> reference, not value as I mistaken thought when I first wrote the code, > > In Python variables are names which refer to objects. > So your assi

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Alan Gauld
"Bill Allen" wrote I am convinced that I had previously assigned part_list to out_list by reference, not value as I mistaken thought when I first wrote the code, In Python variables are names which refer to objects. So your assignment made both names refer to the same object. Question, is

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
Ok, I have definately verified this to myself. The following works perfectly and is a little easier to understand. In this version, I am plainly modifying my parts_list iterator thus producing the effect of an iterator that is growing over the course of the operation of the code. So, I am convi

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
By the way, my guess as to why this is working for me the way it does is that the statement out_list = part_list is actually linking these two objects, making them one. My intention had been to just assign values from one to the other, but I think I have done far more than that. In this case,

[Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
This is a bit embarrassing, but I have crafted a bit of code that does EXACTLY what I what, but I am now a bit baffled as to precisely why. I have written a function to do a bit of webscraping by following links for a project at work. If I leave the code as is, it behaves like it is recursively p