Skip to content

Field '_bypass_evaluation' provided as part of the value of a setting #965

@fswane

Description

@fswane

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions