Do you know if there is a built-in function to build a dictionary from an arbitrary object? I’d like to do something like this:
>>> class Foo:
... bar="hello"
... baz = 'world'
...
>>> f = Foo()
>>> props(f)
{ 'bar' : 'hello', 'baz' : 'world' }
NOTE: It should not include methods. Only fields.