You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It's possible to convert a LazySettings object to a Python dictionary with LazySettings.as_dict(), and there is an alias to to_dict for backwards compatibility. The DynaBox class inherits from the Box class which comes from a vendor. There is the method Box.to_dict()
but not .as_dict(), so there is an inconsistency for the user if the user accesses a sub-box of settings and then tries to convert to a dictionary - see context.
Describe the solution you'd like
Add an alias to DynaBox:
Is your feature request related to a problem? Please describe.
It's possible to convert a
LazySettings
object to a Python dictionary withLazySettings.as_dict()
, and there is an alias toto_dict
for backwards compatibility. TheDynaBox
class inherits from theBox
class which comes from a vendor. There is the methodBox.to_dict()
but not
.as_dict()
, so there is an inconsistency for the user if the user accesses a sub-box of settings and then tries to convert to a dictionary - see context.Describe the solution you'd like
Add an alias to
DynaBox
:The opposite of what is done here:
dynaconf/dynaconf/base.py
Line 424 in 4ab5183
Describe alternatives you've considered
as_dict()
andto_dict()
to_dict()
for bothLazySettings
andDynaBox
as_dict()
LazySettings.as_dict()
and then using keys to get to dict level we wantAdditional context
nested_settings.toml
Examples
The text was updated successfully, but these errors were encountered: