Mercurial > hgrepos > Python > libs > data-schema
comparison data_schema/__init__.py @ 48:a0b464f6ab1f
FIX: Allow only real _Schema instances as schemas in a Context
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 03 Aug 2023 02:19:46 +0200 |
| parents | e7f6fc454f84 |
| children | 6b8fcd0d2175 |
comparison
equal
deleted
inserted
replaced
| 47:e7f6fc454f84 | 48:a0b464f6ab1f |
|---|---|
| 438 def __init__(self, parent, *, key=_SENTINEL, index=_SENTINEL, | 438 def __init__(self, parent, *, key=_SENTINEL, index=_SENTINEL, |
| 439 root_object=_SENTINEL, root_schema=_SENTINEL, | 439 root_object=_SENTINEL, root_schema=_SENTINEL, |
| 440 current_object=_SENTINEL, | 440 current_object=_SENTINEL, |
| 441 settings=_SENTINEL, | 441 settings=_SENTINEL, |
| 442 key_index=_SENTINEL): | 442 key_index=_SENTINEL): |
| 443 if root_schema is not _SENTINEL: | |
| 444 if not isinstance(root_schema, _Schema): | |
| 445 raise TypeError("schema must be a `_Schema' not a pure `dict'") | |
| 443 if parent is None: | 446 if parent is None: |
| 444 if key is not _SENTINEL: | 447 if key is not _SENTINEL: |
| 445 raise TypeError("the root context may not have a key") | 448 raise TypeError("the root context may not have a key") |
| 446 if index is not _SENTINEL: | 449 if index is not _SENTINEL: |
| 447 raise TypeError("the root context may not have an index") | 450 raise TypeError("the root context may not have an index") |
