alecthomas / alecthomas/voluptuous
Exclusive + Required
Abierto
- Lenguaje dominante
- Python
- Estrellas
- 1.9k
- Forks
- 237
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.