我尝试按照示例添加一个新节点,但是:
myitems = ruamel.yaml.load(inp, ruamel.yaml.RoundTripLoader)
myitems['abc'].append('test')
给我一个错误:
Traceback (most recent call last):
File "item_updater.py", line 148, in <module>
myitems['wohnung'].append('test')
AttributeError: 'CommentedMap' object has no attribute 'append'
我正在使用 ruamel.yaml v0.13.7
我究竟做错了什么?