Dump the state of a Python object