Make protobuf methods consistent across python,C++