Using Python, how to check if an object is linked from external blend file?

bpy.data.objects['my linked object'].library I found this code through a search and tried to check the linked object, but in 2.91, this code doesn’t seem to print anything.

Is there a new way to check if an object is linked from external blend file?

You sure its linked and not appended ?