question about how objects are passed as arguments in Python

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

question about how objects are passed as arguments in Python

Aryeh Weiss
If I have an ROI manager define, as in

rm = RoiManager().getInstance()

and then it gets passed as an argument, as in

result = someFunction (rm, other args...)

will a new local copy of the ROI manager be constructed inside
someFunction every time it is called?

If so is there a way to make the ROI manager global and not have it
created locally each time someFunction is called?

I tried something like "global rm" inside the function where rm is
defined , but that did not work.

Thanks in advance for any assistance.
--aryeh

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html