alecthomas / alecthomas/voluptuous
Exclusive + Required
Open
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
I'd love to require exactly one of a few choices, e.g.
``` python
s = Schema({
Exclusive('project_id', 'project', require=True): Coerce(int),
Exclusive('project_name', 'project', require=True): unicode
})
```
(With `require=True` not existing now, but if something like it did, that would be great.)
It's likely this is possible, but I'm not sure how to do it yet. (Is it?)
I'd like `s({})` to fail, for examine, but a schema containing either one of the keys (as is now the case with Exclusive) to pass.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.