1
Fork 0
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:
Steffo 2022-09-06 04:26:26 +02:00
parent a370655026
commit 4fcd65b62e
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -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
===================