On Fri, 3 Jun 2005, [EMAIL PROTECTED] wrote:
> for item in function1(args): > object = class() > if (function2(item)): > if (condition): > object.variable = value > object.function() > print object # debug > print object #debug > > The above pseudo code (not really, but close enough) is essentially what > I'm playing with. I hope it gives a sense of what I'm trying to do. Hello! Hmmm... you may want to modify the print statements slightly to make it more clear which of the two print statements are being displayed. That is, I'd recommend you distinguish the debug statements by putting some kind of mark, like: ###### for item in function1(args): object = class() if (function2(item)): if (condition): object.variable = value object.function() print "inner", object # debug print "outer", object #debug ###### As the code stands, it's not clear that 'condition' is ever set to true. When you mention that: > Any way, the debug lines both print "<__main__.CLASSNAME instance at > ADDRESS>" like they should, but the addresses never match up. there is one alternative explanation for what you're seeing: it's possible that all of the print statements are coming off the outer print statement alone, and that neither the 'function2()' nor 'condition' branches are being taken. I just want to make sure you're testing what you think you're testing. *grin* Best of wishes to you! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor