Got a Doubt ! Wanting for your Help ! Plz make it ASAP !
Grant Edwards
invalid at invalid.invalid
Fri Nov 22 10:08:04 EST 2013
On 2013-11-22, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote:
>
>> 1) Is it possible to Retrieve the address of a variable in python ?
>
> No. Variables in Python are not at fixed addresses, like in Pascal or C,
> they are names in a namespace.
>
> You can read this post for some more information about the difference
> between C variables and Python variables, and calling conventions across
> different languages:
>
> https://mail.python.org/pipermail/tutor/2010-December/080505.html
>
> It's a long post, but to summarise the part about variables:
>
> In languages like Pascal or C, the compiler keeps a table mapping
> variable names to fixed memory addresses, like this:
>
> Variable Address
>======== =======
> x 10234
> y 10238
> z 10242
FWIW, that's only true for some sorts of variables. Other variables
have an address that is relative to a stack or frame pointer.
--
Grant Edwards grant.b.edwards Yow! PEGGY FLEMMING is
at stealing BASKET BALLS to
gmail.com feed the babies in VERMONT.
More information about the Python-list
mailing list