In python there are two types of equality - == and is.
is acts like you expected the comparison to work - it returns True if the two items have the same id. There's no difference between a is b and id(a) == id(b).
Two objects have the same id only if they are actually the same object - meaning they are in the same place in memory, and the a and b are just two references to the same object.
When you create two identical strings, python might be able to understand that they are the same string, only create it once and give you two references to the same string - this is not a problem as strings are immutable. However in many cases, and in your case too, even though two objects are identical python will create two separate instances. In this case, their id won't be the same, but their content will - and this is what == is for.
== only returns True if the objects are identical in content (you can override the way it acts in your classes by implementing the __eq__ method). This is why you usually want to use ==, unless what you're is trying to find out if two variables actually point to the same thing, in which case use is, or id(a) == id(b).
intobjects andstrobjects it compares the value of the string, not the object identity