Get list of attributes of a bpy.data struct? Is there a way, in python, to get a list of each of the attributes that are part of a data struct? For example, I know you can get Object.data, Object.name, Object.location, etc. I've tried doing a basic for loop, but it says that the "object is not iterable."
I know of 2 options : Either looping through object.bl_rna.properties.items() (I think this is the preferred way since this is supported by the API) or looping through dir(object), which is the python way so you might break things if you try to use these attributes if they are not exposed to bl_rna.

Actually I see a third option, which is looking in the official documentation, which at least gives examples and explanations about each attribute.

import bpy

obj = bpy.context.object


print('Using bl_rna :\n')
for prop, value in obj.bl_rna.properties.items():
    print(prop, value)


print('\nUsing dir(object) :\n')
for attr in dir(obj):
    print(str(attr), getattr(obj, attr))




etc.



etc.