alecthomas / alecthomas/voluptuous

Exclusive + Required

Aperta
#115 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.9k
Fork
237
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.