From 7f90b2f342ba338957bb8dfff3ead760edcdd9bf Mon Sep 17 00:00:00 2001 From: Gary Donovan Date: Sun, 3 Apr 2022 01:25:43 +1100 Subject: [PATCH] Remove incorrect comment about lazy evaluation of setting sources (#3806) * Remove incorrect comment about lazy evaluation of setting sources It looks like the current implementation always evaluates every source (https://github.com/samuelcolvin/pydantic/blob/9d631a3429a66f30742c1a52c94ac18ec6ba848d/pydantic/env_settings.py#L73) before coalescing them into a single dictionary to pass to `BaseModel`. So the comment about lazy evaluation is incorrect and should be removed. * Add changelog --- changes/3806-garyd203.md | 1 + docs/usage/settings.md | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 changes/3806-garyd203.md diff --git a/changes/3806-garyd203.md b/changes/3806-garyd203.md new file mode 100644 index 0000000..25b2217 --- /dev/null +++ b/changes/3806-garyd203.md @@ -0,0 +1 @@ +Update documentation about lazy evaluation of sources for Settings (it's not actually done). diff --git a/docs/usage/settings.md b/docs/usage/settings.md index 3ab5821..6bb752a 100644 --- a/docs/usage/settings.md +++ b/docs/usage/settings.md @@ -278,6 +278,3 @@ You might also want to disable a source: {!.tmp_examples/settings_disable_source.py!} ``` _(This script is complete, it should run "as is", here you might need to set the `my_api_key` environment variable)_ - -Because of the callables approach of `customise_sources`, evaluation of sources is lazy so unused sources don't -have an adverse effect on performance.