Bug
- OS: ubuntu 18.04
- Python version
import sys; print(sys.version): 3.7.5 (default, Nov 7 2019, 10:50:52)
- Pydantic version
import pydantic; print(pydantic.VERSION): 1.0b1 or 1.2, but works fine with 0.32
import os
from pydantic import BaseSettings
class MyBaseSettings(BaseSettings):
var: int = 10
class MySubSettings(MyBaseSettings):
class Config:
env_prefix = 'PREFIX_'
os.environ['PREFIX_VAR'] = '2'
k = MySubSettings()
print(k.var) # 10, but should be 2
We expect that k.var will be equal to 2, but it has default value 10.
It's reproduced since 1.0b1.
Bug
import sys; print(sys.version): 3.7.5 (default, Nov 7 2019, 10:50:52)import pydantic; print(pydantic.VERSION):1.0b1or1.2, but works fine with0.32We expect that
k.varwill be equal to 2, but it has default value 10.It's reproduced since 1.0b1.