Are there any declaration keywords in python, like local, global, private, public etc. I know it\'s type free but how do you know if this statement:
x = 5;
An important thing to understand about Python is there are no variables, only "names".
In your example, you have an object "5" and you are creating a name "x" that references the object "5".
If later you do:
x = "Some string"
that is still perfectly valid. Name "x" is now pointing to object "Some string".
It's not a conflict of types because the name itself doesn't have a type, only the object.
If you try x = 5 + "Some string" you will get a type error because you can't add two incompatible types.
In other words, it's not type free. Python objects are strongly typed.
Here are some very good discussions about Python typing:
Edit: to finish tying this in with your question, a name can reference an existing object or a new one.
# Create a new int object
>>> x = 500
# Another name to same object
>>> y = x
# Create another new int object
>>> x = 600
# y still references original object
>>> print y
500
# This doesn't update x, it creates a new object and x becomes
# a reference to the new int object (which is int because that
# is the defined result of adding to int objects).
>>> x = x + y
>>> print x
1100
# Make original int object 500 go away
>>> del y
Edit 2: The most complete discussion of the difference between mutable objects (that can be changed) and immutable objects (that cannot be changed) in the the official documentation of the Python Data Model.