support conversion to Dict where values are PyObjects