如何在immut中使用相同的键获取所有值。字典?

Sap*_*ire 2 python dictionary

ImmutableMultiDict([('course', u'2132'), ('course', u'2121'), 
('myc', u''), ('ok', u'Add to my plan')])
Run Code Online (Sandbox Code Playgroud)

是我用Python编写的WSGI代码中的命令。

现在,我想使用该course键获取所有条目,但args.get("course")只返回的第一个值2132

the*_*eye 5

您可以使用这样的getlist方法

immutable_dict_obj.getlist("course")
Run Code Online (Sandbox Code Playgroud)

这将返回与key对应的值列表course