[Tutor] Equality of numbers and Strings
karim.liateni at free.fr
Mon Jan 10 17:07:44 CET 2011
I am not a beginner in Python language but I discovered a hidden
property of immutable elements as Numbers and Strings.
>>> t = str('xyz')
>>> id(s) == id(t)
Thus if I create 2 different instances of string if the string is
I get the same object in py db. It could be evident but if I do the same
(same elements) with a list it
will not give the same result. Is-it because of immutable property of
strings and numbers?
More information about the Tutor