mirror of
https://github.com/Steffo99/cfig.git
synced 2024-12-03 13:14:19 +00:00
Advanced docs: describe how to access the result_dict
This commit is contained in:
parent
a370655026
commit
4fcd65b62e
1 changed files with 19 additions and 0 deletions
|
@ -34,6 +34,25 @@ Please note that the :meth:`~cfig.config.Configuration.ProxyDict.resolve_failfas
|
|||
...
|
||||
|
||||
|
||||
Access all resolved variables at once
|
||||
=====================================
|
||||
|
||||
In certain cases, you might want to obtain a :class:`dict` containing all resolved variables, without them being proxied.
|
||||
|
||||
You may have noticed that both :meth:`~cfig.config.Configuration.ProxyDict.resolve` and :meth:`~cfig.config.Configuration.ProxyDict.resolve_failfast` return a :class:`dict`: that's exactly what you need!
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 2
|
||||
|
||||
...
|
||||
static_cfg = config.proxies.resolve()
|
||||
...
|
||||
|
||||
.. note::
|
||||
|
||||
Be aware that the :class:`dict` returned will never change, even after a :ref:`reload <Reloading variables>`!
|
||||
|
||||
|
||||
Reloading variables
|
||||
===================
|
||||
|
||||
|
|
Loading…
Reference in a new issue