python interface: extract method print_representation