Can global variable be passed into Python function?

Steven D'Aprano steve at pearwood.info
Thu Feb 27 21:07:20 EST 2014


On Thu, 27 Feb 2014 15:29:01 -0800, Mark H. Harris wrote:

> Knowing that A points to an int, and
> that B=A, now B points to the VERY SAME int...  they are references
> pointing to the same piece of memory. And of course we want new folks to
> understand the issue of: A==B
> True
> A is B
> False
>     .....   and WHY that is or isn't....


If they point to the same piece of memory -- which, by the way, can be 
moved around if the garbage collector supports it -- then A is B cannot 
possibly return False.


-- 
Steven



More information about the Python-list mailing list