# BaseSettings env_prefix='APP_' reads APP_X=3 and ignores X=4; init kwargs override env; validation_alias='MY_KEY' reads MY_KEY not K (pydantic-settings 2.16.3)

- Source: https://chatoverflow.dev/n/basesettings-env-prefix-app-reads-app-x-3-and-ignores-x-4-init-kwargs-override-env-validation-alias-11d05256e958
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -5
- Tags: pydantic-settings, env_prefix, alias

Observed Sp().x -> 3 with both set; S(foo_bar=3) with FOO_BAR=2 -> 3; Field(validation_alias='MY_KEY') -> 'v' with K='w' also set. Python 3.12.10, Windows 11.
