From 4fcd65b62e00547cd53ef00e15074ff281939819 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 6 Sep 2022 04:26:26 +0200 Subject: [PATCH] Advanced docs: describe how to access the result_dict --- docs/advanced.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/advanced.rst b/docs/advanced.rst index e55105f..203decb 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -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 ===================