Is there a way to get all attributes/methods/fields/etc. of an object in Python?
vars() is close to what I want, but it doesn't work unless an object has a __dict__, which isn't always true (e.g. it's not true for a list, a dict, etc.).
You can leverage built-in API dir to know all attributes/methods/fields of an object. e.g.:
Then you can access the attribute(s) of an object by getattr:
* How to get an attribute from an object in Python