Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Cameron Simpson
On 23Nov2014 10:15, Mitch Raful wrote: Thanks for the replies. No worries. My concern was as the for loop keeps sending objects into the do_something() function which uses the same reference name other_object and that the previously instantiated other_objected would be mutated if the functio

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Danny Yoo
On Nov 23, 2014 8:48 AM, "Mitch Raful" wrote: > > Thanks for the replies. My concern was as the for loop keeps sending objects into the do_something() function which uses the same reference name other_object and that the previously instantiated other_objected would be mutated if the function was

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Mitch Raful
On Sun, Nov 23, 2014 at 11:07 AM, Dave Angel wrote: > Please don't top-post. Trim the quoted portion to the parts you're > responding to, and put your response immediately after (each) section you're > commenting on. > I this the correct formatting and in plain text? > Also, you're posting in

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Dave Angel
On 11/23/2014 01:05 PM, Mitch Raful wrote: On Sun, Nov 23, 2014 at 11:07 AM, Dave Angel wrote: Please don't top-post. Trim the quoted portion to the parts you're responding to, and put your response immediately after (each) section you're commenting on. I this the correct formatting and i

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Mitch Raful
Thanks for the replies. My concern was as the for loop keeps sending objects into the do_something() function which uses the same reference name other_object and that the previously instantiated other_objected would be mutated if the function wasn't finished. Or do all languages keep each call t

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Dave Angel
Please don't top-post. Trim the quoted portion to the parts you're responding to, and put your response immediately after (each) section you're commenting on. Also, you're posting in html. That's not always a problem, but it often is, depending on the vagaries of your email program. Just te

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Dave Angel
On 11/22/2014 09:28 PM, Mitch Raful wrote: If I have code similar to this: for object in objects: do_something(object) def do_something(obj): other_object = Class( obj.property) other_object.method( arg1, arg2) do_stuff here with other_object if problem: p

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Alan Gauld
On 23/11/14 02:28, Mitch Raful wrote: If I have code similar to this: for object in objects: do_something(object) def do_something(obj): other_object = Class( obj.property) other_object.method( arg1, arg2) do_stuff here with other_object if problem: print(

Re: [Tutor] How python keeps track of objects

2014-11-23 Thread Steven D'Aprano
On Sat, Nov 22, 2014 at 09:28:35PM -0500, Mitch Raful wrote: > If I have code similar to this: > > for object in objects: > do_something(object) > > def do_something(obj): > other_object = Class( obj.property) > other_object.method( arg1, arg2) > > do_stuff here with other_obje

[Tutor] How python keeps track of objects

2014-11-23 Thread Mitch Raful
If I have code similar to this: for object in objects: do_something(object) def do_something(obj): other_object = Class( obj.property) other_object.method( arg1, arg2) do_stuff here with other_object if problem: print( obj.property ) My concern is that the for l