Support and-schemas in python
This commit is contained in:
parent
1a090ce5ff
commit
597e993c05
|
@ -132,7 +132,11 @@ class SchemaObject:
|
||||||
if k not in v: return None
|
if k not in v: return None
|
||||||
if cls.parse(pp, v[k], args) is None: return None
|
if cls.parse(pp, v[k], args) is None: return None
|
||||||
return ()
|
return ()
|
||||||
raise ValueError('Bad schema')
|
if p.key == AND:
|
||||||
|
for pp in p[0]:
|
||||||
|
if cls.parse(pp, v, args) is None: return None
|
||||||
|
return ()
|
||||||
|
raise ValueError(f'Bad schema {p}')
|
||||||
|
|
||||||
def __preserve__(self):
|
def __preserve__(self):
|
||||||
raise NotImplementedError('Subclass responsibility')
|
raise NotImplementedError('Subclass responsibility')
|
||||||
|
|
Loading…
Reference in New Issue