Operating system: Linux
Graphics card: Intel
Short description of error
When the driver code self is self.id_data is evaluated on an Object property (E.G. Transform) in a file that contains in multiple drivers, it will sometimes return True and sometimes return False, for different updates on the same driver channel.
#Test.py import bpy bpy.app.driver_namespace["Test"] = lambda self: self is self.id_data
I'm not sure whether this is a bug, as the behaviour seems somewhat reasonable given the strictness of identity comparison and the complexity of Blender's API— The object might get moved around in memory or destroyed and re-made or something.
But on the other hand, I also think it seems reasonable to expect a single code line, executed sequentially, to behave consistently in that regard.
I think I was also confused because the behaviour seems much more consistent when the number of drivers is fewer and their relationship is simpler, and because this behaviour doesn't seem to occur in the interactive console (E.G. all(C.active_object is C.active_object.id_data for i in range(10000)) == True). So when testing the expression to figure out whether it's safe to use, I easily concluded that it seems fine, only to have problems once the scene was complex enough for it to be harder to track down the cause.
Also, if you assign self and self.id_data to variables before comparing them, and you print out the variables, then it will actually show that do in fact they have the same memory address (E.G. a, b = self, self.id_data; c = a is b; print(a, b, c) can produce <bpy_struct, Object("ObjectName") at 0x7f4b07a76208, evaluated> <bpy_struct, Object("ObjectName") at 0x7f4b07a76208, evaluated> False, where both Python objects are apparently at 0x7f4b07a76208.)
Exact steps for others to reproduce the error
Open the attached .blend file, then rapidly click "Update Dependencies" on a transform channel's driver until the Cube's location starts jumping around.