What exactly is a python variable?

Chris Angelico rosuav at gmail.com
Thu Nov 17 00:48:18 EST 2016


On Thu, Nov 17, 2016 at 4:40 PM, Veek M <vek.m1234 at gmail.com> wrote:
> In C:
> int x = 10;
> results in storage being allocated and type and location are fixed for
> the life of the program.
>
> In Python,
> x = 10
>
> causes an object '10' to be created but how exactly is 'x' handled?
> Symbol Table lookup at compile time? Is every 'x' being substituted out
> of existence? Because type(x) gives 'int' so..

Here:

http://nedbatchelder.com/text/names1.html

Enjoy!

ChrisA



More information about the Python-list mailing list