Wrap a parsed dict/list in a :class:`_ConfigProxy` so nested access keeps chaining; pass scalars through. Args: parser: the owning :class:`ConfigParser`, used to resolve chained ids. id: the ``::``-separated id that produced ``value``. value: the parsed content to w
(parser: ConfigParser, id: str, value: Any)
| 42 | |
| 43 | |
| 44 | def _wrap_parsed(parser: ConfigParser, id: str, value: Any) -> Any: |
| 45 | """ |
| 46 | Wrap a parsed dict/list in a :class:`_ConfigProxy` so nested access keeps chaining; pass scalars through. |
| 47 | |
| 48 | Args: |
| 49 | parser: the owning :class:`ConfigParser`, used to resolve chained ids. |
| 50 | id: the ``::``-separated id that produced ``value``. |
| 51 | value: the parsed content to wrap. |
| 52 | |
| 53 | Returns: |
| 54 | A :class:`_ConfigProxy` wrapping ``value`` if it is a ``dict`` or ``list``, |
| 55 | otherwise ``value`` unchanged. |
| 56 | """ |
| 57 | if isinstance(value, (dict, list)): |
| 58 | return _ConfigProxy(parser, id, value) |
| 59 | return value |
| 60 | |
| 61 | |
| 62 | class _ConfigProxy: |
no test coverage detected
searching dependent graphs…