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
This violates reasonable assumptions that the type of the value returned by env.foo is always foo, as is otherwise consistent with env.bool, env.int, env.float, etc.:
>>>isinstance(env.str("MYSTR"), str)
False
In this use case, the user should not need to know what a marshmallow.missing is, as it is an implementation detail, and should get back the explicitly set value of empty string rather than needing special logic that knows how to deal with marshmallow.missing.
If the current behavior cannot be changed e.g. for compatibility reasons, it should at least be documented, as this seems like a common use case.
Happy to submit a PR if that would be of interest. Thanks!
The text was updated successfully, but these errors were encountered:
Environs users I'm supporting just hit this:
What? Expected empty string, as explicitly set:
This violates reasonable assumptions that the type of the value returned by
env.foo
is alwaysfoo
, as is otherwise consistent withenv.bool
,env.int
,env.float
, etc.:In this use case, the user should not need to know what a
marshmallow.missing
is, as it is an implementation detail, and should get back the explicitly set value of empty string rather than needing special logic that knows how to deal withmarshmallow.missing
.If the current behavior cannot be changed e.g. for compatibility reasons, it should at least be documented, as this seems like a common use case.
Happy to submit a PR if that would be of interest. Thanks!
The text was updated successfully, but these errors were encountered: