-
-
Notifications
You must be signed in to change notification settings - Fork 318
Field '_bypass_evaluation' provided as part of the value of a setting #965
Description
Describe the bug
When a BoxList containing a dictionary is created, when looking up the value of the BoxList, the field _bypass_evaluation is present in the dictionary. This is unexpected.
To Reproduce
Steps to reproduce the behavior:
Using Dynaconf v3.2.0:
from dynaconf import Dynaconf
settings = Dynaconf()
settings.set("key", [{"d": "v"}])
settings.key
This provides the value of the key as:
<BoxList: [{'d': 'v', '_bypass_evaluation': False}]>
However, it is expected to be:
<BoxList: [{'d': 'v'}]>
Executing under the following environment
This happens in Ubuntu 20.04, python3, using Dynaconf v3.2.0
Proposed solution
The following line:
self._store._box_config["_bypass_evaluation"] = False
at
Line 1174 in 678d29b
| self._store._box_config["_bypass_evaluation"] = False |
can be replaced with:
self._store._box_config.pop("_bypass_evaluation")
This has the same result as setting it to False with the benefit that it is removed completely.