How to check if an object is deleted? For what I understood, I know that an object can be deleted by running bpy.ops.object.delete() when that object is active.

But how can I verify that the object is deleted?

For example:

o = bpy.context.active_object # object I want to delete
print(is_deleted(o)) # False
bpy.ops.object.delete()
print(is_deleted(o)) # True


What should I write in the function is_deleted?
I would do it by object name

def is_deleted(o):
    return not (o.name in bpy.data.objects)

# or instead of a function,
# obj will be None if the object isn't found, 
# else it returns the obj reference
obj = bpy.data.objects.get(o.name)