这就是 PyYAML 在我的机器上的行为方式:
>>> plan = {'Business Plan': ['Collect Underpants', '?', 'Profit']}
>>> print(yaml.dump(plan))
Business Plan: [Collect Underpants, '?', Profit]
我想要的是这个输出(两者都是有效的 YAML):
Business Plan:
- Collect Underpants
- '?'
- Profit
是否有某种选择可以做到这一点?