【发布时间】:2021-01-31 18:33:19
【问题描述】:
假设我想要一本字典,其中至少包含三个键 foo', 'bar', baz 中的一个。以下将允许一个空集。
Schema({
'foo': str,
'bar': int,
'baz': bool
})
很遗憾,我不能这样做:
Any(
Schema({'foo': str}),
Schema({'bar': int}),
Schema({'baz': bool)
)
最好的方法是什么?
【问题讨论】:
标签: python voluptuous