Not a python user here, but leveraging `getattr()` could be a variant:
- https://docs.python.org/3/library/functions.html#getattr
Otherwise `__dict__` should be good enough.
Should anyone have more suggestions, can still add a comment.
I will add a note in the docs.