dotenv icon indicating copy to clipboard operation
dotenv copied to clipboard

Consider removing the .onLoad functionality

Open dshemetov opened this issue 3 years ago • 1 comments

The function in #13 is especially useful when you want to load variables, but not overwrite your env vars. This is moot due to the .onLoad function in this package, which eagerly loads the env vars. FWIW, the python-dotenv package also separates package import and the env var load.

I understand if the migration/backwards incompatibility is not worth it for the maintainers, but just want to open this idea up for your consideration at some point in the future.

dshemetov avatar Apr 14 '23 00:04 dshemetov

Yeah, that would be great, but it would also break practically every project that uses this package, so we cannot do it at this point, at least not by default.

You could opt in into the new behavior by setting an env var. Not as nice, but possible ok?

gaborcsardi avatar Apr 15 '23 09:04 gaborcsardi