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
The return type of DotEnv.dict() is Dict[str, Optional[str]], but it's not clear under what circumstances a value would be None. I haven't delved into the parsing code, but it's not clear to me, even after looking at (e.g.) resolve_variables, parse, etc.
Under what circumstances would one expect to receive a value of None for a particular key? Can this be documented?
The text was updated successfully, but these errors were encountered:
posita
changed the title
Document when a value returned from DotEnv.dict() can be None
Need clarity (perhaps in documentation) regarding when a value returned from DotEnv.dict() can be NoneJan 14, 2022
This possibility was added in #220. It makes it possible to have a variable name with no value in the .env file (i.e. just <name> instead of <name>=<value>), which is reflected as the name being associated with None in the resulting dict.
I agree this should be documented, at least for dotenv_values (DotEnv.dict is a bit less important because it's an internal API).
The return type of
DotEnv.dict()
isDict[str, Optional[str]]
, but it's not clear under what circumstances a value would beNone
. I haven't delved into the parsing code, but it's not clear to me, even after looking at (e.g.)resolve_variables
,parse
, etc.Under what circumstances would one expect to receive a value of
None
for a particular key? Can this be documented?The text was updated successfully, but these errors were encountered: