我想以python形式定义一个与此等效的参数:
request = {'my_param': {'nested_map': {'code':0,'description: 'blah'}}}
下面是我的原型文件:
message MyRequest {
map<string,MyParam> my_param = 1;
}
message MyParam {
map<string, NestedMap> nested_map = 1;
}
message NestedMap {
int32 code = 1;
string description = 2;
}
现在我尝试定义我的请求
request = MyRequest(MyParam(NestedMap(code=0, description='blah')))
TypeError: Argument MyParam is not iterable
为什么会出现这个错误?如何正确定义这一点
目前没有回答
相关问题 更多 >
编程相关推荐