When I create a cube, have it select and run the script
import bpy
selection = bpy.context.selected_objects
print(bool(selection[0].is_property_readonly))
it outputs "True".
I would have guessed that it outputs "False" but it does not. Why? My goal is to test if an object is linked from a different Blender file and because of that I cannot edit its name.