On 23Nov2014 10:15, Mitch Raful <[email protected]> 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 function wasn't finished.

Broadly speaking, each execution of the do_something function has its own "other_object". There is no collision here. (Imagine how painful programming would be if this were not the case.) The flip side of that is that the _name_ "other_object" is not available outside the function, and if you use a variable of that name elsewhere, it too is independent.

Cheers,
Cameron Simpson <[email protected]>

Fear the government that fears your computer. - Jon Drukman <[email protected]>
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to