Testing identity of two data-blocks
In short, for the bpy api use ==, instead of is or comparing the name (which is error prone).

Blender data-blocks * happen not to be Python objects, that is to say, when Blender creates a mesh for example, there exists no Python object for it, until a script asks for one, The way the Python API works, each data-block is a reference to Blender data. therefor id(bpy.context.object) == id(bpy.context.object) won't be equal since each time a new python-object is created.

Note:

This is not the case for all areas of Blender, The game-engine (bge) and the bmesh api's can use identity for comparisons.

Note:

If you do want a unique id() for a data-block you can do:ob1.as_pointer() == ob2.as_pointer(), this is specific to the bpy api.

* In Blender data-block is a general term for a scene, group, mesh, image, material, texture... etc, (avoiding the term object since its confusing in this context)